Search in sources :

Example 1 with Java8TimeDialect

use of org.thymeleaf.extras.java8time.dialect.Java8TimeDialect in project DisCal-Discord-Bot by NovaFox161.

the class ThymeleafTemplateEngine method initialize.

/**
 * Initializes and sets the template resolver
 */
private void initialize(ITemplateResolver templateResolver) {
    templateEngine = new org.thymeleaf.TemplateEngine();
    templateEngine.setTemplateResolver(templateResolver);
    templateEngine.addDialect(new Java8TimeDialect());
}
Also used : Java8TimeDialect(org.thymeleaf.extras.java8time.dialect.Java8TimeDialect)

Example 2 with Java8TimeDialect

use of org.thymeleaf.extras.java8time.dialect.Java8TimeDialect in project tutorials by eugenp.

the class WebMVCConfig method templateEngine.

private TemplateEngine templateEngine(ITemplateResolver templateResolver) {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.addDialect(new Java8TimeDialect());
    engine.setTemplateResolver(templateResolver);
    engine.setTemplateEngineMessageSource(messageSource());
    return engine;
}
Also used : SpringTemplateEngine(org.thymeleaf.spring4.SpringTemplateEngine) GroupingStrategy(nz.net.ultraq.thymeleaf.decorators.strategies.GroupingStrategy) LayoutDialect(nz.net.ultraq.thymeleaf.LayoutDialect) Java8TimeDialect(org.thymeleaf.extras.java8time.dialect.Java8TimeDialect)

Aggregations

Java8TimeDialect (org.thymeleaf.extras.java8time.dialect.Java8TimeDialect)2 LayoutDialect (nz.net.ultraq.thymeleaf.LayoutDialect)1 GroupingStrategy (nz.net.ultraq.thymeleaf.decorators.strategies.GroupingStrategy)1 SpringTemplateEngine (org.thymeleaf.spring4.SpringTemplateEngine)1