Class FreemarkerTemplateLoader
- java.lang.Object
-
- freemarker.cache.URLTemplateLoader
-
- ru.vyarus.guicey.gsp.app.asset.freemarker.FreemarkerTemplateLoader
-
- All Implemented Interfaces:
freemarker.cache.TemplateLoader
public class FreemarkerTemplateLoader extends freemarker.cache.URLTemplateLoaderSpecial template loader for freemarker, required to support custom assets class loaders. It is not required if custom class loaders not used!The problem is that dropwizard views mechanism accepts only template path from classpath so if template provided by a custom class loader, default mechanism would try to load it with application class loader. This loader would take template name (already prepared to be absolute classpath path) and search it through all registered class loaders (based on classpath prefixes).
Loader installed with main builder configuration
ServerPagesBundle.ViewsBuilder.enableFreemarkerCustomClassLoadersSupport()shortcut (applied globally).- Since:
- 12.04.2020
-
-
Constructor Summary
Constructors Constructor Description FreemarkerTemplateLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.net.URLgetURL(java.lang.String name)
-