wood burning stoves 2.0
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

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é

Joined: Nov 24, 2005
Posts: 14688

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
I agree. Here's the link: http://aspose.com/file-tools
subject: difference between valueBound() and attributeAdded()
It's not a secret anymore!