Answer the question
In order to leave comments, you need to log in
Spring, FreeMarker: how to pass your config.properties to the template?
Hello, how to make variable available in html template?
@Value("${param}")
private String param;
@Bean
public FreeMarkerConfigurer freeMarkerConfig() {
Properties settings = new Properties();
settings.setProperty("number_format", "0.##");
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
configurer.setDefaultEncoding("UTF-8");
configurer.setTemplateLoaderPath("/WEB-INF/template");
settings.setProperty("template_exception_handler", "html_debug");
configurer.setFreemarkerSettings(settings);
return configurer;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question