get请求乱码解决

1、修改tomcat的配置文件

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

2、后台代码处理

String userName = new String(request.getParamter("userName").getBytes("ISO8859-1"),"utf-8")

posted @ 2018-04-20 20:03  admin_jh  阅读(143)  评论(0编辑  收藏  举报