public interface [color=red]HttpSessionListener[/color]
extends java.util.EventListener
Implementations of this interface are notified of changes to the list of active sessions in a web application. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application
void sessionCreated(HttpSessionEvent se)
Notification that a session was created.
void sessionDestroyed(HttpSessionEvent se)
Notification that a session is about to be invalidated.
HttpSessionAttributeListener监听
HttpSession中的属性的操作。当在Session增加一个属性时,激发attributeAdded(HttpSessionBindingEvent se) 方法;当在Session删除一个属性时,激发attributeRemoved(HttpSessionBindingEvent se)方法;当在Session属性被重新设置时,激发attributeReplaced(HttpSessionBindingEvent se) 方法。
extends java.util.EventListener
Implementations of this interface are notified of changes to the list of active sessions in a web application. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application
void sessionCreated(HttpSessionEvent se)
Notification that a session was created.
void sessionDestroyed(HttpSessionEvent se)
Notification that a session is about to be invalidated.
HttpSessionAttributeListener监听
HttpSession中的属性的操作。当在Session增加一个属性时,激发attributeAdded(HttpSessionBindingEvent se) 方法;当在Session删除一个属性时,激发attributeRemoved(HttpSessionBindingEvent se)方法;当在Session属性被重新设置时,激发attributeReplaced(HttpSessionBindingEvent se) 方法。
本文介绍了HTTP会话监听器接口及其实现原理。主要探讨了如何通过实现HttpSessionListener接口来监听Web应用中活动会话的变化,包括创建、销毁等事件。此外还介绍了HttpSessionAttributeListener的作用,即监听HttpSession中的属性变化。
646

被折叠的 条评论
为什么被折叠?



