tomcat笔记,编码问题

tomcat coding

Posted by Fe on March 31, 2018
   

tomcat笔记
javaweb项目乱码解决方案

tomcat默认编码

tomcat7及之前版本默认编码格式为iso8859-1

tomcat8以后默认编码格式是utf-8

修改tomcat配置文件

%tomcat%\conf\server.xml中找到

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

这一段配置标签,添加URIEncoding="utf-8",设置默认编码为UTF-8

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

版权声明

本文为博主Fe原创文章,转载请注明出处 https:/fedemo.top/2018/03/31/tomcat-coding/