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

posted @ 2019-08-24 21:38  abcdjava  阅读(2858)  评论(0编辑  收藏  举报