监听器

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


监听对象:request session application

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

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

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

 

posted @ 2020-06-15 10:49  myyismyy  阅读(346)  评论(0编辑  收藏  举报