• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionAttributeListener v/s HttpSessionBindingListener

 
Sandesh Tathare
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?
Sandesh
 
Ko Ko Naing
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic