<filter> <filter-name>encodingFilter</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> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param></filter>
这个一定要在web.xml加上,第二个参数不能少,不然你会返现返回的页面都是乱码
时间: 2025-01-15 10:36:34