码迷,mamicode.com
首页 > 编程语言 > 详细

Spring监听器和过滤器的全局配置

时间:2019-11-12 09:31:47      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:character   char   app   cee   bsp   cte   odi   val   listener   

<!-- 监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

<!-- 过滤器 -->
<filter>
<filter-name>encoding</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>encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

 

 

Spring监听器和过滤器的全局配置

标签:character   char   app   cee   bsp   cte   odi   val   listener   

原文地址:https://www.cnblogs.com/linlangtianshang/p/11839543.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!