But surely theres a better way?
Whould I be better off replacing "session.invalidate()" with "session = null"?
No, you wouldn't be better off -- it won't work. :) There's no reason not to like this solution, IMHO. If it makes your code look ugly, put it in a static method and make it look like this:
if (SessionUtil.isInvalid(session))
justin
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
____________________________________ Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php ____________________________________
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
