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")。

相关文章
|
7月前
|
存储 对象存储
07JavaWeb基础 - ServletContext对象
07JavaWeb基础 - ServletContext对象
22 0
|
10月前
|
存储 缓存 JavaScript
|
12月前
Listener概述、监听对象的创建和销毁、监听域对象属性变化、监听会话相关的感知型监听器及监听器实现
Listener概述、监听对象的创建和销毁、监听域对象属性变化、监听会话相关的感知型监听器及监听器实现
70 0
Servlet学习(六):ServletContext对象的作用
Servlet学习(六):ServletContext对象的作用
Servlet学习(六):ServletContext对象的作用
HttpSession对象的属性操作监听器
HttpSession对象的属性操作监听器的个人理解
HttpServletRequest对象的属性操作监听器
HttpServletRequest对象的属性操作监听器三种常见方法
ServletContext对象的生命周期监听器
ServletContext对象的生命周期监听器的理解
HttpSession对象的生命周期监听器
HttpSession对象的生命周期监听器的个人理解
HttpServletRequest对象的生命周期监听器
HttpServletRequest对象的生命周期监听器的个人理解