tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Smith <>
Subject HttpSessionListener beforeSessionDestroyed (Craig, Sean)?
Date Sat, 14 Dec 2002 02:04:42 GMT
Hello Everyone in Java Land,

I want to use beforeSessionDestroyed. Before going off and extending
HttpSessionListener, I decided to see if it'd been done (why reinvent the

I searched on google for my aptly-named method, and found this:

How can I use this? is there an interface for a StandardHttpSessionListener or
something? If so, does beforeSessionDestroyed give me access to the session
that is about to be destroyed?

If not, I propose to make an interface that extends HttpSessionListener and
provides for beforeSessionDestroyed. To do this, I will create and store a list
in application scope. Each session will get added to the list. When a session
is destroyed, I can loop through the list and find out which session expired: 

for(i = 0; i < list.size(); i ++){

        session = list.get(i);

           - session.getLastAccessedTime()
           > session.getMaxInactiveInterval())

        list.remove(i) = null;

Any advice?


JSP | Servlets | DHTML 

Garrett Needs A Job

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message