Search in sources :

Example 1 with MustacheViewResolver

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;
}
Also used : MustacheViewResolver(org.springframework.web.servlet.view.mustache.MustacheViewResolver) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)1 MustacheViewResolver (org.springframework.web.servlet.view.mustache.MustacheViewResolver)1