Can you please throw light on this point with regards to HttpSessionBindingListener.
The valueBound() method is called BEFORE the object becomes accessible through HttpSession.getAttribute()
Thanks in advance.
Padma priya N.G.
setAttribute
public void setAttribute(java.lang.String name,
java.lang.Object value)Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.
After this method executes, and
1. if the new object implements HttpSessionBindingListener, the container calls HttpSessionBindingListener.valueBound. The container then notifies any HttpSessionAttributeListeners in the web application.
2. If an object was already bound to this session of this name that implements HttpSessionBindingListener, its HttpSessionBindingListener.valueUnbound method is called.
3. If the value passed in is null, this has the same effect as calling removeAttribute().
Example :
1.session.setAttribute("myDog",new Dog("tomy"));
-- Containder after executing setAttribute it will do an additional job of notifying Dog class's listeners(HttpBinding Listener, HttpAttributeListener)(if any).
This listener notification should get finished before getAttribute is called thats the intent of your line posted.
2.session.getAttrinute("myDog");