读书人

GET模式传递中文参数乱码

发布时间: 2012-10-13 11:38:17 作者: rapoo

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");

读书人网 >互联网

热点推荐