处理get请求中文乱码tomcat请求

修改tomcat中server配置:添加

URIEncoding="UTF-8"
<Connector port="8090" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8448" URIEncoding="UTF-8"/>

或者在接收后进行编码转换也是可行的:

deptName = new String(deptName.getBytes("iso8859-1"),"utf-8");

  

posted on 2017-05-24 18:45  ckx0709  阅读(127)  评论(0编辑  收藏  举报

导航