Package jst.test

Source Code of jst.test.EmbedTemplateTest

package jst.test;

import jst.ScriptRuntime;
import jst.FileTemplateLoader;
import jst.TemplateContextImpl;

import java.io.IOException;
import java.io.File;

public class EmbedTemplateTest {

    public static void main(String[] args) throws IOException {
        TemplateContextImpl context = new TemplateContextImpl();
        context.addLoader( new FileTemplateLoader( new File("./test") ) );
        ScriptRuntime runtime = context.load("/embedded-test.jst");
        Object output = runtime.addVariable("name", "Charlie").addVariable("age", 31).invoke();

        System.out.println( output );
    }
}
TOP

Related Classes of jst.test.EmbedTemplateTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.