tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: HttpSessionListener in Tomcat 4.1.27 (or HttpSessionListener in general)
Date Wed, 26 Nov 2003 18:18:49 GMT

By the time sessionDestroyed is call, the session has been invalidated.
That doesn't mean you can't get information about it: only certain
information ;)  HttpSession#getAttribute is clearly documented to throw
an IllegalStateException if called on an invalidated session.

If you're interested in attributes, implement an HttpSessionAttribute or
Binding listener.  In it, you will be notified when an attribute is
removed and you will be able to access its value.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Lukas Bradley []
>Sent: Wednesday, November 26, 2003 1:07 PM
>Subject: HttpSessionListener in Tomcat 4.1.27 (or HttpSessionListener
>When I attempt to access the HttpSession object within the
>sessionDestroyed(), I get the following error.
>DEBUG [StandardManager[]] ( -
>StandardManager[] Session event listener threw exception
>java.lang.IllegalStateException: getAttribute: Session already
>        at
>        at
>        at
>        at
>        at
>        at
>        at
>        at
>        at
>Why would the HttpSessionEvent *seem* like it should have access to the
>session that has just been removed, yet not be able to access it?  Is
>Tomcat problem, or does the Servlet 2.3 spec simply want you to know
>some random session was just invalidated, but you can't get any
>about it.
>Any help appreciated.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message