解决中文乱码
治标:(如果治本方法不行,可用改方法)
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
Get 请求出现乱码
治标:
new String(s.getBytes("iso-8859-1"),"utf-8");
治本:
目录: \apache-tomcat-7.0.47\conf\server.xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URLEncoding="UTF-8"/>