解决Spring MVC前台传参中文乱码问题
程序员文章站
2022-07-07 08:26:09
在web.xml文件中配置字符编码过滤器: ......
在web.xml文件中配置字符编码过滤器:
<filter>
<filter-name>characterencoding</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>
<filter-mapping>
<filter-name>characterencoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
上一篇: 有什么资格讨论核能