ServletContext对象的属性操作监听器

简介: ServletContext对象的属性操作监听器的个人理解

ServletContextAttributeListener接口定义了对于ServletContext对象属性操作的监听行为。
void attributeAdded(ServletContextAttributeEvent scae)
向ServletContext对象中添加属性时会触发该监听方法,并将ServletContext对象传递到该方法中。触发事件的方法servletContext.setAttribute("key","value")。
void attributeRemoved(ServletContextAttributeEvent scae)
当从ServletContext对象中删除属性时会触发该监听方法,并将ServletContext对象传递到该方法中。触发事件方法servletContext.removeAttribute("key")。
void attributeReplaced(ServletContextAttributeEvent scae)
当从ServletContext对象中属性的值发生替换时会触发该监听方法,并将ServletContext对象传递到该方法中。触发事件的方法servletContext.setAttribute("key","value")。

相关文章
|
存储 缓存 JavaScript
Listener概述、监听对象的创建和销毁、监听域对象属性变化、监听会话相关的感知型监听器及监听器实现
Listener概述、监听对象的创建和销毁、监听域对象属性变化、监听会话相关的感知型监听器及监听器实现
86 0
|
Java Spring
任何 bean 初始化回调前自定义逻辑
任何 bean 初始化回调前自定义逻辑
servlet中请求对象与响应对象的生命周期
servlet中请求对象与响应对象的生命周期
104 0
servlet中请求对象与响应对象的生命周期
HttpSession对象的属性操作监听器
HttpSession对象的属性操作监听器的个人理解
HttpServletRequest对象的属性操作监听器
HttpServletRequest对象的属性操作监听器三种常见方法
ServletContext对象的生命周期监听器
ServletContext对象的生命周期监听器的理解
HttpSession对象的生命周期监听器
HttpSession对象的生命周期监听器的个人理解
HttpServletRequest对象的生命周期监听器
HttpServletRequest对象的生命周期监听器的个人理解