Spring MVC - MustacheViewResolver Examples

Code Snippets Spring MVC 

    @Bean
public ViewResolver viewResolver() {
MustacheViewResolver mustacheViewResolver = new MustacheViewResolver();
mustacheViewResolver.setPrefix("/WEB-INF/views/");
mustacheViewResolver.setSuffix(".html");
mustacheViewResolver.setCache(false);

MustacheJTemplateFactory templateFactory = new MustacheJTemplateFactory();
templateFactory.setResourceLoader(resourceLoader);
mustacheViewResolver.setTemplateFactory(templateFactory);
return mustacheViewResolver;
}
Original Post




See Also