Monday, July 9, 2018

HttpSessionBindingEvent and HttpSessionBindingListener


Constructor of  HttpSessionBindingEvent class
  1. public HttpSessionBindingEvent(HttpSession session, java.lang.String name)
  2. public HttpSessionBindingEvent(HttpSession session, java.lang.String name, java.lang.Object value): Constructs an event that notifies an object that it has been bound to or unbound from a session
Methods of  HttpSessionBindingEvent class
  1. public HttpSession getSession(): Return the session that changed.
  2. public java.lang.String getName(): Returns the name with which the attribute is bound to or unbound from the session.
  3. public java.lang.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.
Methods of  HttpSessionBindingListener interface
  1. void valueBound(HttpSessionBindingEvent event): Notifies the object that it is being bound to a session and identifies the session.
  2. void valueUnbound(HttpSessionBindingEvent event): Notifies the object that it is being unbound from a session and identifies the session.

No comments:

Post a Comment