Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Session Listeners

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic