乱码 :javascript中uil带参数跳到action中接收 为乱码 解决

javascript里面
function removeUser(ddid,className){
var url=encodeURI("removeUser.action?user.id.id="+ddid+"& className="+className );
var falg=confirm("确认删除用户,会删除用户下的考试成绩!!","确认","取消");
if(falg){
location.href=url;
}
}
action 里面:
public void setClassName (String className) {
HttpServletRequest request=ServletActionContext.getRequest();
String linename="";
try {
linename = new String(request.getParameter("className").getBytes("ISO-8859-1"),"UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this.className =linename;
}

你可能感兴趣的:(乱码 :javascript中uil带参数跳到action中接收 为乱码 解决)