tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Ruthenbeck <just...@nextengine.com>
Subject Re: Checking for invalidated session
Date Thu, 31 Jul 2003 17:43:54 GMT
At 08:31 AM 7/31/2003, you wrote:
>How can you check to see if a session has already been validated?
>i.e.
>  if( !session.isInvalidated()) <-- what should go here?
>{
>         session.invalidate();
>}
>
>to prevent the following exception:
>"org.apache.jasper.JasperException: invalidate: Session already invalidated"

If you don't want to just catch and ignore the JasperException, then use 
something like this:

try
{
     session.getAttributeNames();
}
catch (java.lang.IllegalStateException isse)
{
     // Session is already invalid
}

justin

____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message