IDEA啟動tomcat中文亂碼問題,Tomcat中文亂碼問題


在啟動tomcat的配置設置里:

 1.VM options: -Dfile.encoding=UTF-8

2.選擇當前項目

3.1:在On 'Update' action:里 選擇Update classes and resources

3.2:在On frame deactivation:里 選擇Update classes and resources

 

4. 打開IDEA的安裝目錄,用記事本打開idea.exe.vmoptions,idea64.exe.vmoptions兩個文件,在末端添加   -Dfile.encoding=UTF-8 

 

 

5.打開IDEA中File的Settings下File Encodings改為UTF-8;

 

 6.打開Tomcat目錄下的conf 中的server.xml文件;

在server.xml文件中添加URIEncoding="utf-8" ,在IDEA運行Tomcat時這通常不會起作用;

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="utf-8" />

 

 

7.打開Tomcat目錄下 conf 中的 logging.properties 文件;

1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8

2localhost.org.apache.juli.AsyncFileHandler.encoding = UTF-8

3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8

4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8

java.util.logging.ConsoleHandler.encoding = UTF-8

7.重啟IDEA


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM