use of ratpack.thymeleaf.internal.FileSystemBindingThymeleafResourceResolver in project ratpack by ratpack.
the class ThymeleafModule method provideTemplateResolver.
@Provides
@Singleton
ITemplateResolver provideTemplateResolver(ServerConfig serverConfig, Config config) {
IResourceResolver resourceResolver = new FileSystemBindingThymeleafResourceResolver(serverConfig.getBaseDir());
TemplateResolver templateResolver = new TemplateResolver();
templateResolver.setResourceResolver(resourceResolver);
templateResolver.setTemplateMode(getTemplatesModeSetting(config));
templateResolver.setPrefix(getTemplatesPrefixSetting(config));
templateResolver.setSuffix(getTemplatesSuffixSetting(config));
templateResolver.setCacheable(getCacheSizeSetting(config) > 0);
// Never use TTL expiration
templateResolver.setCacheTTLMs(null);
return templateResolver;
}
Aggregations