Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HttpSessionAttributeListener v/s HttpSessionBindingListener

Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am little confused with use of HttpSessionAttributeListener and HttpSessionBindingListener.
In case of HttpSessionBindingListener, Causes an object to be notified when it is bound to or unbound from a session.
HttpSessionAttributeListener, This listener interface can be implemented in order to get notifications of changes to the attribute lists of sessions within this web application.
So what's the difference between this two?
Can any one pls explain?
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For HttpSessionBindingListener, the object that implements that intereface will be notified, when Session Attributes of that object is added, removed or replaced...
For HttpSessionAttributeListener, the class that implements this interface must be specified in the Deployment Descriptor. Whenever any session attributes are added, removed and replaced, it will be notified...
As conclusion, HttpSessionBindingListener deals with one session object and HttpSessionAttributeListener deals with all available session objects...
Hope it clears you...
Police line, do not cross. Well, this tiny ad can go through:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic