Web技术ListenerAPI
/**主要监听域对象的创建,属性修改,销毁。
*/
//ServletRequest域
ServletRequestListener srl = null;
//得到事件源,ServletRequestListener的事件处理对象
new ServletContextAttributeEvent(null, null, srl).getSource();
ServletRequestAttributeListener sral;
//得到操作的属性key。ServletRequestAttributeListener事件的处理对象
new ServletContextAttributeEvent(null, null, null).getName();
new ServletContextAttributeEvent(null, null, null).getValue();
//HttpSession域
HttpSessionListener hsl;
HttpSessionAttributeListener hsal;
//对象感知监听器(该对象想知道自己有没有放到session中就可实现该接口)。如果该对象被session绑定(保存到session中),就会触发
HttpSessionActivationListener hsal1;
//该对象(该对象必须实现序列化接口Serializable)有没有被session持久化到硬盘中。
HttpSessionBindingListener hsbl;
//ServletContext域
ServletContextListener scl;
ServletContextAttributeListener scal;