1、get请求
1、获取字符串之后使用new String(name.getBytes("iso-8859-1"),"utf-8")
2、设置request的编码格式,同时在server.xml中添加useBodyEncodingForURI=true属性
3、在server.xml中添加URIEncoding=“utf-8”
2、post请求
1、request.setCharacterEncoding("utf-8")
3、response响应编码
response.setCharacterEncoding("gbk")