朱杰兵blog

jonhney'blog
posts - 140, comments - 1, trackbacks - 0, articles - 0

get提交乱码处理

Posted on 2015-07-07 17:29 朱杰兵 阅读(116) 评论(0)  编辑  收藏

前台:

使用encodeURI()两次转码

var param = "中文";

get方式提交

var url = "aa.html?param="+ 

encodeURI(encodeURI(param));

后台:

String problem = new String(URLDecoder.decode(request
    .getParameter("param"), "utf-8"));

这样转码过后,输出来的值就不会出现乱码了。


只有注册用户登录后才能发表评论。


网站导航: