<!-- 直接在 web.xml 中配置 SpringMVC 提供的过滤器标签:中文,encoding,SpringMVC,EncodingMVC,乱码,jsp From: https://www.cnblogs.com/fkbzr1998/p/16838669.html
注意 url-pattern 为/*
,过滤所有请求(包括 jsp );如果设置为/
,访问 jsp 就不会经过过滤器了!
--> <filter> <filter-name>EncodingMVC</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>EncodingMVC</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>