在eXtremeTable中把Excel格式导出功能加上以后,发现视图页面的中文传递到Action后打印出来的是乱码。。。原因锁定是字符编码的过滤器没起效果。。。解决方法是:
- <filter-mapping>
- <filter-name>Set Character Encoding</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>eXtremeExport</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- ------------正确的写法
如果按一下配置的话,就会处乱码,字符编码的过滤器就没效果了:
- <filter-mapping>
- <filter-name>eXtremeExport</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>Set Character Encoding</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- -----------错误的写法
关于web.xml中多个<filter>的运行顺序,我理解得还不大清楚。
http://xuliduo.javaeye.com/blog/241233