spring字符集过滤器配置
<!-- spring的字符集过滤器 --> <filter> <filter-name>Spring character encoding filter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>Spring character encoding filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
?
在web.xml中直接配置以上代码段,即可实现字符集的过滤