關于jsp頁面間,通過url傳遞參數,出現亂碼的問題.
1 . request.setCharacterEncoding("utf-8");
只適合Post方法提交的數據,
2 . 適合用Get方法提交的數據
String name = request.getParameter("name");
name=new String(name.getBytes(“ISO8859_1”),“UTF-8”);
3 .
針對Tomcat服務器,修改server.xml
<Connector port="8083" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
這個只使用GET方法,不適合Post方法
只適合Post方法提交的數據,
2 . 適合用Get方法提交的數據
String name = request.getParameter("name");
name=new String(name.getBytes(“ISO8859_1”),“UTF-8”);
3 .
針對Tomcat服務器,修改server.xml
<Connector port="8083" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
這個只使用GET方法,不適合Post方法
posted on 2010-08-23 20:04 chenjinlong 閱讀(200) 評論(0) 編輯 收藏