使用spring框架自带的字符拦截器
1、只需在web.xml中配置即可
<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><!--设置使用spring的字符拦截器--> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
相关推荐
smalllove 2020-11-03
greensomnuss 2020-10-27
feinifi 2020-10-14
RickyIT 2020-09-27
meleto 2020-08-17
MicroBoy 2020-08-02
牧场SZShepherd 2020-07-20
容数据服务集结号 2020-07-19
与卿画眉共浮生 2020-11-13
hellowordmonkey 2020-11-02
丽丽 2020-10-30
周太郎 2020-10-28
职业炮灰 2020-10-16
与卿画眉共浮生 2020-10-14
feinifi 2020-10-13
yangjinpingc 2020-10-09
davis 2020-09-29
lisongchuang 2020-09-27