Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need some explanation of HttpSessionBinding Listener

 
Farooq Ali
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody
can some one please tell me about the HttpSessionBinding Listener. & how can I use it in my project.
I am using a servlet which first verifies a user then gets info from a database regarding that user.
Afterwards pass that info to a couple of JSP files.
I had thought of using simple HttpSession object's setAttribute() & getAttribute() methods for the project.
I need some feedback whether I am going on the right track or not??
Farooq
 
Thandapani Saravanan
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessionBindingListener is an Interface which needs to be implmented by classes of those objects who want to be notified when a session object is created/removed.
Simply, we can write code that gets executed whenever those objects are put/removed into/from session.
As for passing info about the user to subsequent JSP pages, you can use the session mechanism to remember between pages.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic