response.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
request.setCharacterEncoding("utf-8");
PrintWriter out =response.getWriter();
还是不行,出现乱码肯定是页面解析编码是出现问题,
最后在
Login.html 文件的<head>中更改编码<meta http-equiv="content-type" content="text/html" ?charset="GB2312">将原来的utf-8改成了gb2312.乱码问题解决。
request.getRequestDispatcher("login.html");页面乱码
原文地址:http://blog.51cto.com/8675042/2112474