1、简介
用来监听Servlet组件对象状态发生变化的组件可以监听的源包括:ServetRequest、HttpSession、ServletContext当监听到事件源状态发生变化时,会有对应的响应行为
2、使用方法
在web.xml文件中配置
通过@WebListener 注解配置,在监听器上加注解
3、监听器对象接口事件
监听对象监听接口监听事件ServletRequestServletRequestListener ServletRequestAttributeListenerServletRequestEvent ServletRequestAttributeEventHttpSession HttpSessionListener HttpSessionActivationListener HttpSessionAttributeListender HttpSessionBindingListenderHttpSessionEvent HttpSessionBindingEventServletContextServletContextListener ServletContextAttributeListener ServletContextEvent ServletContextAttributeEvent
相关文章
发表评论