URL中多参数传递+中文乱码问题
程序员文章站
2022-04-02 22:09:38
...
在jsp的请求中 都参数且有中文
Action处理
window.location=encodeURI('<%=basePath%>admin.do?method=login&adminname='+textname+'&password='+textpassword+'&roleid='+roleid+'');
Action处理
String adminname = new String(request.getParameter("adminname").getBytes("ISO-8859-1"),"UTF-8");
String password = new String(request.getParameter("password").getBytes("ISO-8859-1"),"UTF-8");
String roleid = URLDecoder.decode(request.getParameter("roleid"), "UTF-8");