關(guān)于jsp頁面間,通過url傳遞參數(shù),出現(xiàn)亂碼的問題.
1 . request.setCharacterEncoding("utf-8");只適合Post方法提交的數(shù)據(jù),
2 . 適合用Get方法提交的數(shù)據(jù)
String name = request.getParameter("name");
name=new String(name.getBytes(“ISO8859_1”),“UTF-8”);
3 .
針對Tomcat服務(wù)器,修改server.xml
<Connector port="8083" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
這個只使用GET方法,不適合Post方法