Package org.thymeleaf.templateresolver

Examples of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver


    private final Logger log = LoggerFactory.getLogger(ThymeleafConfiguration.class);

    @Bean
    @Description("Thymeleaf template resolver serving HTML 5 emails")
    public ClassLoaderTemplateResolver emailTemplateResolver() {
        ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
        emailTemplateResolver.setPrefix("mails/");
        emailTemplateResolver.setSuffix(".html");
        emailTemplateResolver.setTemplateMode("HTML5");
        emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8);
        emailTemplateResolver.setOrder(1);
        return emailTemplateResolver;
    }
View Full Code Here


        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }

    @Bean
    public ClassLoaderTemplateResolver templateResolver() {
        ClassLoaderTemplateResolver result = new ClassLoaderTemplateResolver();
        result.setPrefix("views/");
        result.setSuffix(".html");
        result.setTemplateMode("HTML5");
        return result;
    }
View Full Code Here

        initializeTemplateEngine(false, 3600000L);
    }

    private static void initializeTemplateEngine(boolean cacheable, Long timeToLive)
    {
        TemplateResolver templateResolver = new ClassLoaderTemplateResolver();
        templateResolver.setTemplateMode("HTML5");
        templateResolver.setSuffix(".html");
        templateResolver.setCacheable(cacheable);
        templateResolver.setCacheTTLMs(timeToLive);

        templateEngine = new TemplateEngine();
        templateEngine.setTemplateResolver(templateResolver);
    }
View Full Code Here

    private final Logger log = LoggerFactory.getLogger(ThymeleafConfiguration.class);

    @Bean
    @Description("Thymeleaf template resolver serving HTML 5 emails")
    public ClassLoaderTemplateResolver emailTemplateResolver() {
        ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
        emailTemplateResolver.setPrefix("mails/");
        emailTemplateResolver.setSuffix(".html");
        emailTemplateResolver.setTemplateMode("HTML5");
        emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8);
        emailTemplateResolver.setOrder(1);
        return emailTemplateResolver;
    }
View Full Code Here

       
        Validate.notNull(node, "Node cannot be null");
        Validate.notNull(templateWriter, "Template writer cannot be null");

        final TemplateEngine templateEngine = new TemplateEngine();
        templateEngine.addTemplateResolver(new ClassLoaderTemplateResolver());
        templateEngine.addMessageResolver(new StandardMessageResolver());
        templateEngine.setTemplateModeHandlers(StandardTemplateModeHandlers.ALL_TEMPLATE_MODE_HANDLERS);
       
        final String templateName = "output";
View Full Code Here

        Validate.notNull(source, "Source cannot be null");
        Validate.notNull(parser, "Template parser cannot be null");

        final Configuration configuration = new Configuration();
        configuration.addTemplateResolver(new ClassLoaderTemplateResolver());
        configuration.addMessageResolver(new StandardMessageResolver());
        configuration.setTemplateModeHandlers(StandardTemplateModeHandlers.ALL_TEMPLATE_MODE_HANDLERS);
        configuration.initialize();

        return getDOMFor(configuration, source, parser);
View Full Code Here

  private TemplateEngine myTitleTemplateEngine;

  public BaseThymeleafNarrativeGenerator() {
    configuration = new Configuration();
    configuration.addTemplateResolver(new ClassLoaderTemplateResolver());
    configuration.addMessageResolver(new StandardMessageResolver());
    configuration.setTemplateModeHandlers(StandardTemplateModeHandlers.ALL_TEMPLATE_MODE_HANDLERS);
    configuration.initialize();
  }
View Full Code Here

  private TemplateEngine myTitleTemplateEngine;

  public BaseThymeleafNarrativeGenerator() {
    configuration = new Configuration();
    configuration.addTemplateResolver(new ClassLoaderTemplateResolver());
    configuration.addMessageResolver(new StandardMessageResolver());
    configuration.setTemplateModeHandlers(StandardTemplateModeHandlers.ALL_TEMPLATE_MODE_HANDLERS);
    configuration.initialize();
  }
View Full Code Here

  private TemplateEngine myTitleTemplateEngine;

  public BaseThymeleafNarrativeGenerator() {
    configuration = new Configuration();
    configuration.addTemplateResolver(new ClassLoaderTemplateResolver());
    configuration.addMessageResolver(new StandardMessageResolver());
    configuration.setTemplateModeHandlers(StandardTemplateModeHandlers.ALL_TEMPLATE_MODE_HANDLERS);
    configuration.initialize();
  }
View Full Code Here

    return templateEngine;
  }

  @Bean
  public TemplateResolver templateResolver() {
    TemplateResolver templateResolver = new ClassLoaderTemplateResolver();
    templateResolver.setPrefix("/views/");
    templateResolver.setSuffix(".html");
    templateResolver.setTemplateMode("HTML5");
    return templateResolver;
  }
View Full Code Here

TOP

Related Classes of org.thymeleaf.templateresolver.ClassLoaderTemplateResolver

Copyright © 2018 www.massapicom. 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.