|
|
|
@ -19,11 +19,14 @@ public class ThymeleafViewResolverConfig {
|
|
|
|
|
public SpringResourceTemplateResolver templateResolver() {
|
|
|
|
|
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
|
|
|
|
|
//templateResolver.setPrefix("classpath:/templates");
|
|
|
|
|
|
|
|
|
|
templateResolver.setPrefix("/WEB-INF/templates/thymeleaf");
|
|
|
|
|
templateResolver.setCharacterEncoding("UTF-8");
|
|
|
|
|
templateResolver.setSuffix(".html");
|
|
|
|
|
|
|
|
|
|
templateResolver.setCharacterEncoding("UTF-8");
|
|
|
|
|
templateResolver.setTemplateMode("HTML5");
|
|
|
|
|
templateResolver.setCacheable(false);
|
|
|
|
|
|
|
|
|
|
return templateResolver;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -33,7 +36,6 @@ public class ThymeleafViewResolverConfig {
|
|
|
|
|
templateEngine.setTemplateResolver(templateResolver());
|
|
|
|
|
templateEngine.setTemplateEngineMessageSource(messageSource);
|
|
|
|
|
templateEngine.addDialect(layoutDialect());
|
|
|
|
|
|
|
|
|
|
return templateEngine;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -48,6 +50,8 @@ public class ThymeleafViewResolverConfig {
|
|
|
|
|
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
|
|
|
|
|
viewResolver.setTemplateEngine(templateEngine(messageSource));
|
|
|
|
|
viewResolver.setCharacterEncoding("UTF-8");
|
|
|
|
|
String[] viewNames = {"thymeleaf"};
|
|
|
|
|
viewResolver.setViewNames(viewNames);
|
|
|
|
|
viewResolver.setOrder(1);
|
|
|
|
|
return viewResolver;
|
|
|
|
|
}
|
|
|
|
|