SpringMVC中文乱码问题的解决

it2023-01-23  51

在web.xml中配置Spring提供的过滤器类 

<!-- 配置过滤器解决乱码问题--> <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>

 

最新回复(0)