String username = request.getParameter("username"); //乱码
String password = request.getParameter("password"); //乱码
//先用iso8859-1编码 在使用utf-8解码
//乱码解决
username = new String(username.getBytes("iso8859-1"), "UTF-8");
password = new String(password.getBytes("iso8859-1"), "UTF-8");
System.out.println(username);
System.out.println(password);
Servlet获取到的JSP乱码解决方法
最新推荐文章于 2021-04-07 20:09:50 发布