I'm trying to use Freemarker for e-mail templating in a web application.
I have declared a FreeMarkerConfigurationFactoryBean as follow:
@Bean
public FreeMarkerConfigurationFactoryBean freeMarkerConfigurationFactoryBean(EmailTemplateService templateService) {
FreeMarkerConfigurationFactoryBean configurationFactoryBean = new FreeMarkerConfigurationFactoryBean();
configurationFactoryBean.setPreTemplateLoaders(templateService);
return configurationFactoryBean;
}
When running my JUnit everything is working well, but when running in my webapp my bean is "overriden" by the spring boot FreeMarkerAutoConfiguration.
I have tried to:
- remove the spring-boot-starter-freemarker from my gradle file
- @EnableAutoConfiguration(exclude = {FreeMarkerAutoConfigurationk.class})
- spring.freemarker.enabled=false
But without success. Any idea?
Thanks guys.
Aucun commentaire:
Enregistrer un commentaire