修改tomcat编码
在TOMCAT中的server.xml中的
<Connector中添加 URIEncoding="UTF-8" //对URI使用utf-8编码处理
1
2
|
<Connector URIEncoding= "UTF-8"
connectionTimeout= "20000" maxThreads= "150" port= "8888" protocol= "HTTP/1.1" redirectPort= "8443" />
|
或
<Connector中添加两个设置useBodyEncodingForURI="true" //设置POST和GET使用相同编码
URIEncoding="UTF-8" //对URI使用utf-8编码处理
?
useBodyEncodingForURI="true" 这个可以添加也可不添加可根据开发环境POST和GET是否一样的;
URIEncoding="UTF-8" 一般只要设置了这个就OK
本文转自ling118 51CTO博客,原文链接:http://blog.51cto.com/meiling/1550543,如需转载请自行联系原作者