Blog / 阅读

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

by admin on 2014-03-15 11:06:00 in ,



首先要在doPost()方法里面注明编码request的编码方式:request.setCharacterEncoding("utf-8");或request.setCharacterEncoding("gbk");

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

这样就可以了。


写评论

相关文章

下一篇:DES加密算法详解- -

评论

写评论

* 必填.

分享

栏目

赞助商


热门文章

Tag 云