解决中文乱码
设置请求和响应的编码方式
request.setCharacterEncoding("utf-8")
response.setCharacterEncoding("utf-8")
<%@page language ="java" contentType="text/html"; charset="utf-8"%>
get请求出现乱码
治标的方法:new String(s.getByte("iso-8859-1"),"utf-8");
治本的方法:配置tomcat\conf\server.xml文件
URIEncoding='UTF-8'
useBodyEncodingForURI="true"
<Connector connectionTimeout="20000"port="8080">
protocol = "HTTP/1.1" redirectPort="8843" URIEncoding="UTF-8"/>