• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Listeners

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Axel, and yes I am Catalan form Barcelona
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, HttpSessionAttributeListener is configured in the deployment descriptor.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool answer Satya..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic