java – 与Thymeleaf的utf8 charset

前端之家收集整理的这篇文章主要介绍了java – 与Thymeleaf的utf8 charset前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

当使用Spring和Thymeleaf时,我所有的西里尔字符都显示为?????在页面上.

运用

@RequestMapping(value =“/ login”,method = RequestMethod.GET,produce =“text / html; charset = utf-8”)

正如在此建议:https://stackoverflow.com/a/11866822/1479414和这里:https://stackoverflow.com/a/12023816/1479414没有帮助.

如何解决这个问题?

@H_404_12@最佳答案
答案可以在here找到:

应该为templateResolver和ThymeleafViewResolver显式设置属性characterEncoding:

原文链接:https://www.f2er.com/spring/431875.html

猜你在找的Spring相关文章