监听器

监听器
开发步骤:
a.编写监听器,实现接口
b.配置web.xml


监听对象:request session application

a.监听对象的创建和销毁
request:ServletRequestListener
session:HttpSessionListener
application:ServletContextListener
每个监听器 各自提供了2个方法:监听开始、监听结束的方法

ServletContext在servlet容器启动时自动创建

b.监听对象中的属性的变更
request:ServletRequestAttributeListener
session:HttpSessionAttributeListener
application:ServletContextAttributeListener

原文地址:https://www.cnblogs.com/mayouyou/p/13129623.html