最终解决方案在F:\jboss-4.0.2\jboss-4.0.2\server\default\deploy\jboss-ws4ee.sar
里的server.xml
中加一个URIEncoding="UTF-8"
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
//以下解决方案不能解决根本问题
System. out.println("gameName
original"+game.getGameName());
System. out.println("gameName
utf-8:" +new String(game.getGameName().getBytes( "ISO-8859-1"),"utf-8" ));
System. out.println("gameName
gbk:" +new String(game.getGameName().getBytes( "ISO-8859-1"),"gbk" ));
gameName = URLDecoder. decode(game.getGameName(), "UTF-8").trim();//game.getGameName().trim();
System. out.println("gameName
decodeUTF-8"+URLDecoder.decode(game .getGameName(), "UTF-8"));
System. out.println("gameName
decodeGBK"+URLDecoder.decode(game .getGameName(), "gbk"));
if(isUrl==null){//非url形式访问的
gameName = game.getGameName().trim();
} else{// url形式访问的
gameName = new String(game.getGameName().getBytes( "ISO-8859-1"),"utf-8" );
game.setGameName(new String(game.getGameName().getBytes( "ISO-8859-1"),"utf-8" ));
}