use of ratpack.groovy.template.internal.CachingTemplateResolver in project ratpack by ratpack.
the class MarkupTemplateModule method provideTemplateEngine.
@SuppressWarnings("UnusedDeclaration")
@Provides
@Singleton
MarkupTemplateEngine provideTemplateEngine(ServerConfig serverConfig, Config config) {
ClassLoader parent = Thread.currentThread().getContextClassLoader();
TemplateConfiguration effectiveConfiguration = new TemplateConfiguration(config);
// not copied by constructor
effectiveConfiguration.setCacheTemplates(config.isCacheTemplates());
Path templatesDir = serverConfig.getBaseDir().file(config.getTemplatesDirectory());
return new MarkupTemplateEngine(parent, effectiveConfiguration, new CachingTemplateResolver(templatesDir));
}
Aggregations