jboss7和tomcat7编码配置(中文搜索乱码)

时间:2022-04-13 08:22:50
1)Jboss找到\jboss-as-7.1.1.Final\standalone\configuration下的standalone.xml配置文件,在
   <extensions>......</extensions>下加上:
    <system-properties>
        <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
        <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
    </system-properties>
2)Tomcat下找到\Tomcat 7.0\conf下的server.xml配置文件,修改
 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" />行加上URIEncoding="UTF-8" 属性,
 即下面修改的结果:
 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8" />