//处理中文件乱码的一种方式:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain){
try {
request.setCharacterEncoding("GBK");
chain.doFilter(request, response);
}catch (Exception e) {
System.out.println(e.getMessage());
}
}
====================================================================================
web.xml:
<filter>
<filter-name>StrutsFilter</filter-name>
<filter-class>com.snprint.autosendinfo.pub.StrutsFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>StrutsFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>