• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Session Listeners

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When should the HttpSessionBindingListener be used versus the HttpSessionAttributeListener? I know I am missing something, but the two listeners seem somewhat repetitive. Is the Binding Listener based on the deprecated Value methods? I probably missed it but I have looked at the JavaDocs, the O'Reilly tutorial, and the Specs over the last couple of weeks. Thanks!
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe it goes something like this. If a class implements the HttpSessionBindingListener, an object of that class will be notified when it is bound or unbound to the session.
If a class implements the HttpSessionAttributeListener, that object will be notified if any objects are added, removed or replaced in the session.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The difference is that HttpSessionBindingListener can be implemented to notify any object, while HttpSessionAttributeListener is only used for attribute list.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic