• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listeners

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Axel, and yes I am Catalan form Barcelona
 
Allan Moster
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, HttpSessionAttributeListener is configured in the deployment descriptor.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bottomline is who speaks and who listens....
HttpSessionBingdingListener: Session talks and the Class (implementing HttpSessionBingdingListener) listens.

HttpSessionAttributeListener: Application talks and Session object listens.
- satya
[ February 13, 2002: Message edited by: Madhav Lakkapragada ]
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool answer Satya..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic