Examples of FileTemplateLoader


Examples of freemarker.cache.FileTemplateLoader

        File file = path.getFile()// will fail if not resolvable in the file system
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Template loader path [" + path + "] resolved to file path [" + file.getAbsolutePath() + "]");
        }
        return new FileTemplateLoader(file);
      }
      catch (IOException ex) {
        if (logger.isDebugEnabled()) {
          logger.debug("Cannot resolve template loader path [" + templateLoaderPath +
              "] to [java.io.File]: using SpringTemplateLoader as fallback");
View Full Code Here

Examples of jst.FileTemplateLoader

    private void initializeContext() throws IOException {
        if( context == null ) {
            context = new TemplateContextImpl();
            for( File resourcePath : resourcePaths ) {
                context.addLoader( new FileTemplateLoader( resourcePath ) );
            }
        }
    }
View Full Code Here

Examples of jst.FileTemplateLoader

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 );
    }
View Full Code Here
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.