Filter过滤器配置:
在web配置文件中添加如下配置:
<filter>
<filter-name>自定义一个名称</filter-name>
<filter-class>自定义过滤器类的路径</filter-class>
<init-param> <param-name>encoding</param-name> <param-value>gbk</param-value> </init-param>
</filter>
<filter-mapping>
<filter-name>自定义的名称注:要与filter-name节点名称一致</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
如果是url的get提交参数带中文的 ,可以改下面这个文件,加入一个URIEncoding="GBK" 文件目录在:X:\Tomcat 5.5\conf\Server.xml
<Connector port="8080" redirectPort="8443" minSpareThreads="25"
connectionTimeout="30" maxThreads="150" maxSpareThreads="75"
URIEncoding="GBK">