概述从前端传过来的数据如果包含中文,中文会变成乱码 解决办法在web.xml中添加以下代码: 12345678910111213<!--配置Spring MVC的乱码过滤--><filter> <filter-name>CharacterEncodingFilter</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>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern></filter-mapping>