首先要在doPost()方法里面注明编码request的编码方式:request.setCharacterEncoding("utf-8");或request.setCharacterEncoding("gbk");
如果还不行,就要给单独request的属性进行重新编码:例:String name= new String(request.getParameter("name").getBytes("ISO-8859-1"),"utf-8") ;
这样就可以了。
post方式提交request.getParamter();乱码解决方法,布布扣,bubuko.com
post方式提交request.getParamter();乱码解决方法
原文:http://blog.csdn.net/frightingforambition/article/details/21241491