Search in sources :

Example 1 with CustomMessageResolver

use of org.ff4j.web.thymeleaf.CustomMessageResolver in project ff4j by ff4j.

the class FF4jServlet method initializeTemplateEngine.

/**
 * Initialize Thymeleaf.
 */
private void initializeTemplateEngine() {
    ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
    templateResolver.setTemplateMode("XHTML");
    templateResolver.setPrefix("views/view-");
    templateResolver.setSuffix(".html");
    templateResolver.setCacheTTLMs(3600000L);
    templateEngine = new TemplateEngine();
    templateEngine.setTemplateResolver(templateResolver);
    templateEngine.addMessageResolver(new CustomMessageResolver());
    LOGGER.info("Thymeleaf has been initialized");
}
Also used : ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver) TemplateEngine(org.thymeleaf.TemplateEngine) CustomMessageResolver(org.ff4j.web.thymeleaf.CustomMessageResolver)

Aggregations

CustomMessageResolver (org.ff4j.web.thymeleaf.CustomMessageResolver)1 TemplateEngine (org.thymeleaf.TemplateEngine)1 ClassLoaderTemplateResolver (org.thymeleaf.templateresolver.ClassLoaderTemplateResolver)1