tomcat取带有中文的参数乱码的解决办法
1. 对于post参数,可以用filter来处理,在dofilter之前,加入以下代码:
request.setCharacterEncoding("UTF-8");
2. 对于get参数,直接修改tomcat的conf/server.xml配置来完成:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
参考资料:
http://blog.csdn.net/hongqishi/article/details/7428380