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 executing code when session dies Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "executing code when session dies" Watch "executing code when session dies" New topic
Author

executing code when session dies

Kieth Nogins
Greenhorn

Joined: Mar 10, 2006
Posts: 18
hi,
I want to let my web application know when a session dies. Is there a way
to execute some code whenever the session dies for whatever reason?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

You could implement a session listener.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Kieth Nogins
Greenhorn

Joined: Mar 10, 2006
Posts: 18
who???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

Here's the steps I would take:

1. Upon reading that someone said I should use a "session listener", I would open a browser window and do a net search on "session listener"

2. Seeing that first result (at least on a google search) references a class named HttpSessionListener, I do a search on that.

3. This yields the javaoc for the HttpSessionListener class

4. I read that javadoc

5. Knowledge happens


P.S. A google search of the JavaRanch forums also yields 105 hits.
[ May 06, 2006: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executing code when session dies
 
Similar Threads
not understanding a question
how does the server expire the session
Confusion about session destruction
how to make remeber me service
Doubt on Sun Assessment Q26