ValueUnbound method is called when setAttribute method is called on an object that implements the HttpSessionBindingListener interface and the object already exists in the session
 Technote (troubleshooting)
 
Problem(Abstract)
What is the differences between the servlet 2.2 Javadoc and the 2.3 Javadoc for the HttpSession.setAttribute() method as it relates to the objects that implement the HttpSessionBindingListener interface?
 
Resolving the problem
  • In the servlet 2.2 Javadoc for HttpSession, the method setAttribute states:
    If an object of the same name is already bound to the session, the object is replaced. After this method executes, and if the object implements HttpSessionBindingListener, the container calls HttpSessionBindingListener.valueBound.

  • In the servlet 2.3 Javadoc for HttpSession, the method setAttribute states:
    If an object was already bound to this session of this name that implements HttpSessionBindingListener, its HttpSessionBindingListener.valueUnbound method is called.

  • Additional Notes:
    Some implementations of WebSphere® Application Server V4.0 use HttpSessionBindingListener.valueBound to know when a session object was being invalidated. This method will still be called when the session object is being invalidated but the implementation might also have a class that implements the HttpSessionListener Interface to be notified when the session is being destroyed.
 
Related information
Servlet 2.2 Javadoc
Servlet 2.3 Javadoc
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Sessions and Session Management
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1154578
IBM Group: Software Group
Modified date: Dec 8, 2004