tomcat8以下版本并不能自动转码所以在使用Tomcat7的时候出想传递参数异步提交的时候乱码就可以加入这样一段代码乱码问题轻松解决,不过还是建议使用tomcat8及以上版本,好使
//接收rname参数 String rname = request.getParameter("rname"); //tomcat8以下传递参数情况下中文乱码问题可以试试这个办法 rname = new String(rname.getBytes("iso-8859-1"),"utf-8");
tomcat8以下版本并不能自动转码所以在使用Tomcat7的时候出想传递参数异步提交的时候乱码就可以加入这样一段代码乱码问题轻松解决,不过还是建议使用tomcat8及以上版本,好使
//接收rname参数 String rname = request.getParameter("rname"); //tomcat8以下传递参数情况下中文乱码问题可以试试这个办法 rname = new String(rname.getBytes("iso-8859-1"),"utf-8");