Listener监听器生命周期

attributeAdded(ServletContextAttributeEvent event)  向appliction中添加属性时调用

attributeRemoved(ServletContextAttributeEvent event)  从appliction中删除属性时调用

attributeReplaced(ServletContextAttributeEvent event)  替换application中的属性时调用

HttpSessionAttributeListener

attributeAdded(HttpSessionBindingEvent event)

attributeRemoved(HttpSessionBindingEvent event)

attributeReplaced(HttpSessionBindingEvent event)

ServletRequestAttributeListener

attributeAdded(ServletRequestAttributeEvent event)

attributeRemoved(ServletRequestAttributeEvent event)

attributeReplaced(ServletRequestAttributeEvent event)

       以上监听器接口除了传参不同,方法名都是一样的。分别监听application,session,request对象的属性变化。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/c1a109c3420fac8a2401edb3f48adf38.html