• 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

Confusion in HttpSessionBindingListener and HttpSessionAttributeListener

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
can someone tell me what is the major difference between HttpSessionBindingListener and HttpSessionAttributeListener. becoz these two interfacing is confusing me. I think the functionality of interfaces is all most if i understood their functionality right.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HttpSessionAttributeListener interface allows a developer to recieve notifications whenever changes occur to the attribute list of the HttpSession object such as adding a new attribute,removing an existing attribute and replacing an existing attribute.it is configured in deployment descripter.
HttpSessionBingingListener is implemented by the classes whose object need to recieve notifications whenever they are added to or removed from a session.It's not required to explicitly mention it in deployment descriptor.Hence an object is added to or removed from any session,the container calls the interface implemented by that object.
Regards,
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
The servlet container calls method on an object implementing HttpSessionBindingListener only if that particular object is added or removed from the session. On the otherhand if a listener class implements HttpSessionAttributeListener, container will call its method if any object is added or removed from session.
---------------
Sainudheen
 
Adnan Ahmed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nauman Khan
i was making a little mistake but now i have understood
 
Adnan Ahmed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nauman Khan
i was making a little mistake but now i have understood
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic