This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Session and header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session and header" Watch "Session and header" New topic
Author

Session and header

David Qiu
Greenhorn

Joined: May 14, 2001
Posts: 8
Hi, friends. Is there any event listener to listen to the session creation and destroyment event? And another is that how to fetch header information set by HttpServletResponse interface?
thanks.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
U can get it using response.getAllHeaders() function. This will return an Enumeration. U can iterate through it.
And u can implement HttpSessionBindingListener interface in the object that u are binding to the session. There are 2 methods in this interface. valueBound() and one more method to listen to unbound event. U can override these methods.
regards
Rajesh
 
Don't get me started about those stupid light bulbs.
 
subject: Session and header
 
Similar Threads
Java gurus please! Detecting browser close, Framesets, and Threads in Servlets
when user close the browse how i update the data related to that user in databse ?
WA #1.....word association
Session retention
how to store data