tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Einfeldt" <>
Subject Problem with invalidating a session
Date Wed, 08 Jan 2003 12:34:42 GMT

I have following little jsp:


  // Stripped down to the bare minimum. In the real life
  // this is intended to happen only on specific conditions
  session = request.getSession(true);

  // Now there is a new session
  session.putValue("Test", "Test");

Some Content (Only reached with Scope != session)

The useBean with scope session fails as the pageContext
holds a reference to the invalidated session.
That causes tomcat to throw a IllegalStateException:
getAttribute: Session already invalidated

Although I quite understand why this happens, I couldn't find
in the 1.2 Spec anything that denies this kind of usage.

Is the spec just not precise enough or am I to blind to see it ?

Has anybody a solution to work around this problem beside using 
a response.redirect() directly after invalidating the session?

BTW: Please don't shout 'Do not use scriptlets in jsps', the
code has to run in a jsp engine that doesn't support taglibs 
and filters. 

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

View raw message