一、問題
新建的基於SpringBoot的MVC項目,在請響應體中,如果有中文,會顯示為亂碼。
二、解決方案
1、在application.properties中設置:
spring.http.encoding.force=true spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true server.tomcat.uri-encoding=UTF-8
一、問題
新建的基於SpringBoot的MVC項目,在請響應體中,如果有中文,會顯示為亂碼。
二、解決方案
1、在application.properties中設置:
spring.http.encoding.force=true spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true server.tomcat.uri-encoding=UTF-8
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。