页面编码方式为utf-8
当使用post传值时
request.setContentType("utf-8");
当使用get传值时
String str = request.getParameter("str");
str = new String(str.getBytes("iso-8859-1"),"utf-8");
当然,直接改变Web应用服务器的编码(如Tomcat的编码)。
备注:必须与页面编码一致。
原文:http://www.cnblogs.com/xiaoxian1369/p/4007400.html