`

jsp到action用get方法相互传中文时乱码的解决方案

    博客分类:
  • J2EE
阅读更多

jsp->action:

        //转码
    	toCity = new String(getRequest().getParameter("toCity").getBytes("ISO-8859-1"),"UTF-8");

 action->jsp

//是汉字,刚编码成非汉字
toCity = URLEncoder.encode(toCity, "utf-8");
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics