request.getRequestDispatcher("login.html");頁面亂碼

在使用 request.getRequestDispatcher("Login.html").include(request, response);時,中文顯示出現了亂碼,在dopost方法裏也已經進行了設置,
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.亂碼問題解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章