aspose file tools*
The moose likes Servlets and the fly likes executing code when session dies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
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: 61433
    
  67

You could implement a session listener.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kieth Nogins
Greenhorn

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

Joined: Jan 10, 2002
Posts: 61433
    
  67

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 ]
 
Don't get me started about those stupid light bulbs.
 
subject: executing code when session dies