GET方式传递中文参数乱码

document.location="http://localhost:8080/css/AddStuInfoServlet?sname=" + encodeURIComponent (document.loginform.sname.value);


servlet中:String name= new String(request.getParameter("sname").getBytes("ISO-8859-1"),"UTF-8");

你可能感兴趣的:(get)