I need to specify more than one template loader path for Freemer in the Spring Boot web application, but only one path Specify the property using, which uses the setTemplateLoaderPath
method in FreeMarkerConfigurationFactory
. However, this class allows me to set many paths using the setTemplateLoaderPaths
method. What is the best way to override this auto-configuration class and specify multiple loader paths? I'm not really able to understand the Spring Java Configuration class and I want an example for this, which I want before writing code. I am using Spring Boot 1.1.2. thank you in advanced.
You must type your own bean org.springframework .web.servlet.view. Freemarker.FreeMarkerConfigurer
with your desired configuration. To do this, add one of the following to the Java configuration classes of your application:
@Bin Public Free Marker Configurator Free MarkersFigurer () {FreeMarkerConfigurer Configr = new FreeMarkerConfigurer () ; Configure.setTemplateLoaderPaths ("one", "two", "three"); // Apply more configuration as expected Return Configuration; } Updates: The latest Spring Boots 1.2 snapshots now accept comma separated list for spring. Freemer.TemplateLoaderPath property lets you specify several paths without any declaration: a custom free marker configurator
beam.
Comments
Post a Comment