更新时间:2023-01-01 11:53:14
您应该尝试将 utf 添加到 thymeleaf 视图解析器:
You should try to add utf to thymeleaf view resolver:
Bean
public ThymeleafViewResolver viewResolver() {
ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
thymeleafViewResolver.setTemplateEngine(templateEngine());
thymeleafViewResolver.setCharacterEncoding("UTF-8");
return thymeleafViewResolver;
}