常用几种Listener使用详解
文章平均质量分 80
qq371808586
这个作者很懒,什么都没留下…
展开
-
ServletContextListener使用详解
在 Servlet API 中有一个 ServletContextListener 接口,它能够监听 ServletContext 对象的生命周期,实际上就是监听 Web 应用的生命周期。 当Servlet 容器启动或终止Web 应用时,会触发ServletContextEvent 事件,该事件由ServletContextListener 来处理。在 ServletContextListen...原创 2016-05-11 09:26:25 · 130 阅读 · 0 评论 -
HttpSessionListener 使用详解
HttpSessionListener : Session创建事件发生在每次一个新的session创建的时候,类似地Session失效事件发生在每次一个Session失效的时候。这个接口也只包含两个方法,分别对应于Session的创建和失效:# public void sessionCreated(HttpSessionEvent se); # public void sessionDest...原创 2016-05-11 09:57:46 · 640 阅读 · 0 评论 -
spring的ContextLoaderListener使用详解
ContextLoaderListener监听器的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。至于ApplicationContext.xml这个配置文件部署在哪,如何配置多个xml文件,书上都没怎么详细说明。现在的方法就...原创 2016-05-11 10:06:07 · 173 阅读 · 0 评论 -
spring的IntrospectorCleanupListener使用详解
"在服务器运行过程中,Spring不停的运行的计划任务和OpenSessionInViewFilter,使得Tomcat反复加载对象而产生框架并用时可能产生的内存泄漏,则使用IntrospectorCleanupListener作为相应的解决办法。" 对于这一句话,引用关于IntrospectorCleanupListener一段解释: 引用 spring中的提供了一个名为org.spri...原创 2016-05-11 10:16:52 · 186 阅读 · 0 评论 -
Filter监听器的使用——同一个web.xml可以配置多个fileter
可以通过配置Filter对所有请求进行监听拦截处理: <filter> <filter-name>Compress</filter-name> <filter-class>com.enation.framework.gzip.GZIPFilter</filter-class> </filter>...原创 2016-05-11 10:41:20 · 1415 阅读 · 0 评论