use of org.thymeleaf.templateresolver.ServletContextTemplateResolver in project nutzboot by nutzam.
the class MainLauncher method init.
public void init() {
engine = new TemplateEngine();
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(Mvcs.getServletContext());
templateResolver.setTemplateMode(TemplateMode.TEXT);
engine.setTemplateResolver(templateResolver);
tmpDir = new File(conf.get("nutz.maker.tmpdir", "/tmp/maker")).getAbsoluteFile();
}
use of org.thymeleaf.templateresolver.ServletContextTemplateResolver in project tutorials by eugenp.
the class TestConfig method templateResolver.
@Bean
public ServletContextTemplateResolver templateResolver() {
final ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("HTML5");
return templateResolver;
}
use of org.thymeleaf.templateresolver.ServletContextTemplateResolver in project irida by phac-nml.
the class MvcConfiguration method templateResolver.
/**
* Create a new {@link ServletContextTemplateResolver} and set defaults.
*
* @return {@link ServletContextTemplateResolver}
*/
@Bean
public ServletContextTemplateResolver templateResolver() {
ServletContextTemplateResolver resolver = new ServletContextTemplateResolver();
resolver.setPrefix(TEMPLATE_PREFIX);
resolver.setSuffix(TEMPLATE_SUFFIX);
resolver.setTemplateMode(TEMPLATE_MODE);
resolver.setOrder(TEMPLATE_ORDER);
resolver.setCacheable(false);
return resolver;
}
use of org.thymeleaf.templateresolver.ServletContextTemplateResolver in project java-docs-samples by GoogleCloudPlatform.
the class MetadataServlet method init.
@Override
public void init() {
// Setup ThymeLeaf
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(this.getServletContext());
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
// TTL=20m
templateResolver.setCacheTTLMs(Long.valueOf(1200000L));
// Cache is set to true by default. Set to false if you want templates to
// be automatically updated when modified.
templateResolver.setCacheable(true);
templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
}
use of org.thymeleaf.templateresolver.ServletContextTemplateResolver in project yqq by yeycfri.
the class WebConfig method templateResolver.
@Bean
public TemplateResolver templateResolver() {
TemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix("classpath:/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("LEGACYHTML5");
return templateResolver;
}
Aggregations