请求乱码问题解决
1.使用 String 进行重新编码:uname=new String(uname.getBytes("iso8859-1"),"utf-8");
2.Get 方式请求:
在 service 方法中使用: req.setCharacterEncoding(“utf-8”);
在 tomcat 服务器目录下的 conf 文件下找到 server.xml 文件,打开进行如下配置:
3.Post 方式请求:
在 service 方法中使用: req.setCharacterEncoding(“utf-8”);