找到$CATALINA_HOME/conf/server.xml
1.Tomcat在独立模式下运行
修改HTTP连接器配置
<Connector port="9090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
在配置中添加URIEncoding="UTF-8"属性。
2.Tomcat在应用服务器模式下运行(应用服务器模式下,Tomcat由AJP连接Web服务器(如Apache、IIS))
修改AJP连接器配置
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
和HTTP连接器配置
<Connector port="9090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
在这两个配置中各添加URIEncoding="UTF-8"属性。