頁面本身有中文的時候
一定要寫在PrintWriter out=resp.getWriter();之前
要寫Resp.setContentType("text/html;charset=gbk");
解決get方式亂碼問題:
修改Server.xml中的URLEncoding="GBK";
解決post方式提交內容的亂碼
一定要寫在存取第一個參數之前
不要調用reponse.setCharacterEncoding("GBK");
要寫Request.setCharacterEncoding("GBK");