Spring mvc中文乱码问题解决

<filter>
 <filter-name>encodingFilter</filter-name>
 <filterclass>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>encodingFilter</filter-name>
 <url-pattern>/*</url-pattern>
</filter-mapping>

只需在 web.xml 添加 Spring MVC ⾃带的过滤器即可加入过滤器filter即可

上一篇:javaweb有弹窗出现乱码


下一篇:图解python | 字符串及操作