use of org.springframework.web.servlet.view.mustache.MustacheViewResolver in project alf.io by alfio-event.
the class MvcConfiguration method getViewResolver.
@Bean
public ViewResolver getViewResolver(Environment env) throws Exception {
MustacheViewResolver viewResolver = new MustacheViewResolver();
viewResolver.setSuffix("");
viewResolver.setTemplateFactory(getTemplateFactory());
viewResolver.setOrder(1);
// disable caching if we are in dev mode
viewResolver.setCache(env.acceptsProfiles(Initializer.PROFILE_LIVE));
viewResolver.setContentType("text/html;charset=UTF-8");
return viewResolver;
}
Aggregations