加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

java – 与Thymeleaf的utf8 charset

发布时间:2020-12-15 01:23:16 所属栏目:大数据 来源:网络整理
导读:当使用Spring和Thymeleaf时,我所有的西里尔字符都显示为?????在页面上. 运用 @RequestMapping(value =“/ login”,method = RequestMethod.GET,produce =“text / html; charset = utf-8”) 正如在此建议:https://stackoverflow.com/a/11866822/1479414和这

当使用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没有帮助.

如何解决这个问题?

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读