javax.servlet.http
类 HttpSessionBindingEvent

java.lang.Object
  继承者 java.util.EventObject
      继承者 javax.servlet.http.HttpSessionEvent
          继承者 javax.servlet.http.HttpSessionBindingEvent
所有已实现的接口:
Serializable

public class HttpSessionBindingEvent
extends HttpSessionEvent

Events of this type are either sent to an object that implements HttpSessionBindingListener when it is bound or unbound from a session, or to a HttpSessionAttributeListener that has been configured in the deployment descriptor when any attribute is bound, unbound or replaced in a session.

The session binds the object by a call to HttpSession.setAttribute and unbinds the object by a call to HttpSession.removeAttribute.

作者:
Various
另请参见:
HttpSession, HttpSessionBindingListener, HttpSessionAttributeListener, 序列化表格

字段摘要
 
从类 java.util.EventObject 继承的字段
source
 
构造方法摘要
HttpSessionBindingEvent(HttpSession session, String name)
          Constructs an event that notifies an object that it has been bound to or unbound from a session.
HttpSessionBindingEvent(HttpSession session, String name, Object value)
          Constructs an event that notifies an object that it has been bound to or unbound from a session.
 
方法摘要
 String getName()
          Returns the name with which the attribute is bound to or unbound from the session.
 HttpSession getSession()
          Return the session that changed.
 Object getValue()
          Returns the value of the attribute that has been added, removed or replaced.
 
从类 java.util.EventObject 继承的方法
getSource, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

HttpSessionBindingEvent

public HttpSessionBindingEvent(HttpSession session,
                               String name)
Constructs an event that notifies an object that it has been bound to or unbound from a session. To receive the event, the object must implement HttpSessionBindingListener.

参数:
session - the session to which the object is bound or unbound
name - the name with which the object is bound or unbound
另请参见:
getName(), getSession()

HttpSessionBindingEvent

public HttpSessionBindingEvent(HttpSession session,
                               String name,
                               Object value)
Constructs an event that notifies an object that it has been bound to or unbound from a session. To receive the event, the object must implement HttpSessionBindingListener.

参数:
session - the session to which the object is bound or unbound
name - the name with which the object is bound or unbound
另请参见:
getName(), getSession()
方法详细信息

getSession

public HttpSession getSession()
Return the session that changed.

覆盖:
HttpSessionEvent 中的 getSession

getName

public String getName()
Returns the name with which the attribute is bound to or unbound from the session.

返回:
a string specifying the name with which the object is bound to or unbound from the session

getValue

public Object getValue()
Returns the value of the attribute that has been added, removed or replaced. If the attribute was added (or bound), this is the value of the attribute. If the attribute was removed (or unbound), this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.

从以下版本开始:
Servlet 2.3


Copyright © 2013. All Rights Reserved.