1. 程式人生 > >資料庫中的使用者名稱是中文名(中文亂碼問題)登陸的3個方法

資料庫中的使用者名稱是中文名(中文亂碼問題)登陸的3個方法

1.重新轉碼u=new String(u.getBytes("iso-8859-1"),"gb2312");

2.使用過濾器解決(待補充)

3.通過配置server.xml檔案  

   在<Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443" />後新增URIEncoding="gb2312"(或者GBK、UTF-8)

<Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443"  URIEncoding="gb2312"/>