SpringMVC_编码过滤器
通过过滤器统一请求与响应的编码格式:
<!--字符编码过滤器--> <filter> <filter-name>encoding</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>encoding</filter-name> <!--对所有请求都生效--> <url-pattern>/*</url-pattern> </filter-mapping>