I'm having an issue with my view resolver not being able to find my appropriate freemarker template.
Is there a way to tell the resolver bean and/or spring to output the file path it is looking for?
ie if my controller returns a viewName of "home" I'd expect an output something like "/WEB-INF/views/home.ftl".
My freemarker bean definitions follow:
@Bean
public ViewResolver getViewResolver() {
FreeMarkerViewResolver resolver = new FreeMarkerViewResolver();
resolver.setCache(false);
resolver.setPrefix("");
resolver.setSuffix(".ftl");
return resolver;
}
@Bean
public FreeMarkerConfig getFreemarkerConfig() {
Properties props = new Properties();
props.setProperty("number_format","0.##");
props.setProperty("locale","en-GB");
Configuration configuration = new Configuration();
configuration.setDefaultEncoding("UTF-8");
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
configurer.setFreemarkerSettings(props);
configurer.setConfiguration(configuration);
configurer.setTemplateLoaderPath("/WEB-INF/views/");
return configurer;
}