解决js中传值,Action获取是乱码问题

1、先在js中进行编码

var str = $("mytext").val();
//转码,两次 
str = encodeURI(str);
str = encodeURI(str);
window.location = 'admin/reportQueryExcel.do?ruleText='+str;

2、action中进行解码

URLDecoder.decode(request.getParameter("ruleText"),"utf-8");


posted on 2013-08-01 22:35  itmyhome  阅读(213)  评论(0编辑  收藏  举报

导航