wood burning stoves*
The moose likes Servlets and the fly likes difference between valueBound() and attributeAdded() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "difference between valueBound() and attributeAdded()" Watch "difference between valueBound() and attributeAdded()" New topic
Author

difference between valueBound() and attributeAdded()

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
what's the difference between valueBound() of HttpSessionBindingListener, and attributeAdded() of HttpSessionAttributeListener. Both are called when an attribute is added to a session. valueBound()is implemented by the attribute itself, and attributeAdded()is implemented by some other class.


have a great day,
krishna prasad
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The difference resides in the type of listener you use. If you want to listen to the Session, you'll use HHttpSessionAttributeListener and then be able to check every attributes added to it.
If you want to know when a particular attribute is being bound to a session, you will use HttpSessionBindingListener.
[ September 04, 2006: Message edited by: Satou kurinosuke ]

[My Blog]
All roads lead to JavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: difference between valueBound() and attributeAdded()
 
Similar Threads
Questins related to Session Listeners
difference b/w HttpSessionBindingListner and HttpSessionAttributeListner
regarding session
listener interfaces ..
What will be the behavior of SessionActivation Listener in this case.