File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Confusion in HttpSessionBindingListener  and HttpSessionAttributeListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Confusion in HttpSessionBindingListener  and HttpSessionAttributeListener" Watch "Confusion in HttpSessionBindingListener  and HttpSessionAttributeListener" New topic
Author

Confusion in HttpSessionBindingListener and HttpSessionAttributeListener

Adnan Ahmed
Greenhorn

Joined: Aug 18, 2003
Posts: 17
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.


SCJP1.2 <br />SCWCD1.4
Nauman Khan
Ranch Hand

Joined: Aug 07, 2003
Posts: 49
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,


Nauman Khan <br />SCJP,MCSE,SCWCD,SCBCD,SCWCD1.4
Sainudheen Mydeen
Ranch Hand

Joined: Aug 18, 2003
Posts: 218
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

Joined: Aug 18, 2003
Posts: 17
Thanks Nauman Khan
i was making a little mistake but now i have understood
Adnan Ahmed
Greenhorn

Joined: Aug 18, 2003
Posts: 17
Thanks Nauman Khan
i was making a little mistake but now i have understood
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confusion in HttpSessionBindingListener and HttpSessionAttributeListener