您的位置:首页 > 产品设计 > UI/UE

post方式提交request.getParamter();乱码解决方法

2014-03-14 16:43 246 查看
首先要在doPost()方法里面注明编码request的编码方式:request.setCharacterEncoding("utf-8");或request.setCharacterEncoding("gbk");

如果还不行,就要给单独request的属性进行重新编码:例:String name= new String(request.getParameter("name").getBytes("ISO-8859-1"),"utf-8") ;

这样就可以了。


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: