Listeners

Anonymous

Ranch Hand

Posts: 18944

posted 14 years ago

Hi! Which interface should be implemented by a class so that it's objects may receive notifications when they are put or removed from HttpSession? The answer is HttpSessionBingdingListener. What is de difference between HttpSessionAttributeListener and HttpSessionBingdingListener? Thank you in advance.

faiza haris

Ranch Hand

Posts: 173

posted 14 years ago

Hi Jordi HttpSessionBindingListener has methods valueBound(HttpSessionBindingEvent) valueUnbound(HttpSessionBindingEvent) So whenever an obj is being bound to a session, the notification comes thru this method.Similarly valueUnbound notifies if obj is unbound frm session. faiza

Anonymous

Ranch Hand

Posts: 18944

posted 14 years ago

Hi Faiza! I know this, I think that my problem is that I don�t know the exact signification of bound because my english is not good. Can you explain me please? Thank you.

Axel Janssen

Ranch Hand

Posts: 2166

posted 14 years ago

Hi, I am just starting with this listener stuff. So I might be wrong. Jordi: bind-bound-bound is like atar in my rusty spanish (you have a very catalan name). An object is bound (atado) to a session). The important part of the question is: it's objects may receive notifications . HttpSessionBindingListener is implemented by the object which is bound to the session. HttpSessionAttributeListener listens globally about if an attribute has been removed or added from all the sessions. Axel

Anonymous

Ranch Hand

Posts: 18944

posted 14 years ago

Thank you Axel, and yes I am Catalan form Barcelona

Allan Moster

Ranch Hand

Posts: 153

posted 14 years ago

Also, HttpSessionAttributeListener is configured in the deployment descriptor.

Madhav Lakkapragada

Ranch Hand

Posts: 5040

posted 14 years ago

The bottomline is who speaks and who listens.... HttpSessionBingdingListener: Session talks and the Class (implementing HttpSessionBingdingListener) listens.