org.thymeleaf.extras.java8time.dialect.Java8TimeDialect Java Examples

The following examples show how to use org.thymeleaf.extras.java8time.dialect.Java8TimeDialect. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WallRideThymeleafConfiguration.java    From wallride with Apache License 2.0 6 votes vote down vote up
@Bean
	public SpringTemplateEngine templateEngine(WallRideThymeleafDialect wallRideThymeleafDialect) {
		SpringTemplateEngine engine = new SpringTemplateEngine();
//		engine.setTemplateResolver(templateResolver());
		Set<ITemplateResolver> templateResolvers = new LinkedHashSet<>();
		templateResolvers.add(homePathTemplateResolver());
		templateResolvers.add(classPathTemplateResolver());
		engine.setTemplateResolvers(templateResolvers);

		Set<IDialect> dialects = new HashSet<>();
		dialects.add(new SpringSecurityDialect());
		dialects.add(new Java8TimeDialect());
		dialects.add(wallRideThymeleafDialect);
		engine.setAdditionalDialects(dialects);
		return engine;
	}
 
Example #2
Source File: EmailMessageTemplateAutoConfiguration.java    From magic-starter with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean(MessageConstants.EMAIL_TEMPLATE_ENGINE_BEAN)
public TemplateEngine templateEngine(@Qualifier(MessageConstants.EMAIL_TEMPLATE_RESOLVER_BEAN) SpringResourceTemplateResolver templateResolver) {
	SpringTemplateEngine engine = new SpringTemplateEngine();
	engine.addDialect(new Java8TimeDialect());
	engine.addTemplateResolver(templateResolver);
	engine.getConfiguration();

	return engine;
}
 
Example #3
Source File: WebAdminConfiguration.java    From wallride with Apache License 2.0 5 votes vote down vote up
@Bean
public SpringTemplateEngine templateEngine() {
	SpringTemplateEngine engine = new SpringTemplateEngine();
	Set<ITemplateResolver> resolvers = new HashSet<>();
	resolvers.add(adminTemplateResolver());
	engine.setTemplateResolvers(resolvers);

	Set<IDialect> dialects = new HashSet<>();
	dialects.add(new SpringSecurityDialect());
	dialects.add(new Java8TimeDialect());
	dialects.add(wallRideThymeleafDialect);
	engine.setAdditionalDialects(dialects);
	return engine;
}
 
Example #4
Source File: WallRideMailConfiguration.java    From wallride with Apache License 2.0 5 votes vote down vote up
@Bean(name = "emailTemplateEngine")
public SpringTemplateEngine emailTemplateEngine() {
	SpringTemplateEngine engine = new SpringTemplateEngine();
	Set<ITemplateResolver> resolvers = new HashSet<>();
	resolvers.add(emailTemplateResolver());
	engine.setTemplateResolvers(resolvers);

	Set<IDialect> dialects = new HashSet<>();
	dialects.add(wallRideThymeleafDialect);
	dialects.add(new Java8TimeDialect());
	engine.setAdditionalDialects(dialects);
	return engine;
}
 
Example #5
Source File: WebMVCConfig.java    From tutorials with MIT License 5 votes vote down vote up
private ISpringTemplateEngine 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;
}
 
Example #6
Source File: WebMvcConfig.java    From konker-platform with Apache License 2.0 4 votes vote down vote up
@Bean
public Java8TimeDialect java8TimeDialect() {
    return new Java8TimeDialect();
}
 
Example #7
Source File: MvcConfig.java    From fredbet with Creative Commons Attribution Share Alike 4.0 International 4 votes vote down vote up
@Bean
public Java8TimeDialect java8TimeDialect() {
    return new Java8TimeDialect();
}
 
Example #8
Source File: ThymeleafConfiguration.java    From WTFDYUM with Apache License 2.0 4 votes vote down vote up
@Bean
public Java8TimeDialect java8TimeDialect() {
    return new Java8TimeDialect();
}
 
Example #9
Source File: ThymeleafTemplateEngine.java    From spark-template-engines with Apache License 2.0 4 votes vote down vote up
/**
 * Initializes and sets the template resolver
 */
private void initialize(ITemplateResolver templateResolver) {
    templateEngine = new org.thymeleaf.TemplateEngine();
    templateEngine.setTemplateResolver(templateResolver);
    templateEngine.addDialect(new Java8TimeDialect());
}