1. 重新定義。 String str = "衝蟲蟲" ; str = new String(u.getBytes("iso-8859-1"),"utf-8");
2. 使用過濾器解決。
3. 修改Tomcat配置server.xml,
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />改爲:
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" URIEconding="UTF-8" redirectPort="8443" />