Class FreemarkerConfiguration


  • public abstract class FreemarkerConfiguration
    extends Object
    Access point for a singleton Configuration instance. The instance is created at system startup, so we can fail early if there are any problems. The Configuration is slightly extended to hold request-based information in a ThreadLocal. The net result is although there is only one configuration (and hence only one template cache), each request gets a customization with its own locale, etc. Each time a request asks for the configuration, check to see whether the cache is still valid, whether the theme has changed (needs a new TemplateLoader), and whether the DeveloperSettings have changed (might need a new TemplateLoader). Store the request info to the ThreadLocal.
    • Constructor Detail

      • FreemarkerConfiguration

        public FreemarkerConfiguration()
    • Method Detail

      • getConfig

        public static freemarker.template.Configuration getConfig​(javax.servlet.http.HttpServletRequest req)