Java Code Examples for org.thymeleaf.TemplateEngine#addTemplateResolver()
The following examples show how to use
org.thymeleaf.TemplateEngine#addTemplateResolver() .
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: TemplateUtils.java From SkaETL with Apache License 2.0 | 5 votes |
private TemplateUtils() { StringTemplateResolver templateResolver = new StringTemplateResolver(); templateResolver.setTemplateMode(TemplateMode.HTML); // TODO Cacheable or Not ? templateResolver.setCacheable(false); stringTemplateEngine = new TemplateEngine(); stringTemplateEngine.addTemplateResolver(templateResolver); }
Example 2
Source File: ThymeleafConfiguration.java From graviteeio-access-management with Apache License 2.0 | 5 votes |
@Bean public ThymeleafTemplateEngine getTemplateEngine() { ThymeleafTemplateEngine thymeleafTemplateEngine = ThymeleafTemplateEngine.create(vertx); TemplateEngine templateEngine = thymeleafTemplateEngine.getDelegate().getThymeleafTemplateEngine(); // set template resolvers DomainBasedTemplateResolver overrideTemplateResolver = (DomainBasedTemplateResolver) overrideTemplateResolver(); overrideTemplateResolver.setTemplateEngine(templateEngine); templateEngine.setTemplateResolver(overrideTemplateResolver); templateEngine.addTemplateResolver(defaultTemplateResolver()); return thymeleafTemplateEngine; }
Example 3
Source File: TemplateEngineModule.java From EDDI with Apache License 2.0 | 5 votes |
private TemplateEngine createTemplateEngine(TemplateMode templateMode) { TemplateEngine templateEngine = new TemplateEngine(); StringTemplateResolver templateResolver = new StringTemplateResolver(); templateResolver.setTemplateMode(templateMode); templateEngine.addTemplateResolver(templateResolver); return templateEngine; }
Example 4
Source File: AbstractThymeleafBuilder.java From ogham with Apache License 2.0 | 5 votes |
protected TemplateEngine buildEngine() { TemplateEngine builtEngine; if (engine != null) { LOG.debug("Using custom Thymeleaf engine"); builtEngine = engine; } else if (engineBuilder != null) { LOG.debug("Using custom Thymeleaf engine built using engine()"); builtEngine = engineBuilder.build(); } else { LOG.debug("Using default Thymeleaf engine"); builtEngine = buildContext.register(new TemplateEngine()); } builtEngine.addTemplateResolver(buildTemplateResolver(builtEngine)); return builtEngine; }