web.xml中如下配置:
<filter>
<filter-name>SetCharsetEncodingFilter</filter-name>
<filter-class>com.buy.util.EncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SetCharsetEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-07 09:57:20