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


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session" Watch "Session" New topic
Author

Session

Vallabhaneni Suresh Kumar
Ranch Hand

Joined: Mar 01, 2004
Posts: 68
In servlets I want to do something,when the session expires.How to achive this?

Thank you
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Check this out.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionListener.html
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
To add to the previous (excellent) reply:
- You implement HttpSessionListener.
your implementation would have code to run when session expires.
- You register this class in your web.xml:
<listener>
<listener-class>yourPackage.YourListener</listener-class>
</listener>
 
Consider Paul's rocket mass heater.
 
subject: Session
 
jQuery in Action, 3rd edition