Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Expired session gives illegal state exception  RSS feed

 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everybody,
I know this topic has been beaten to tender death, but i think i need some new info. I am using Tomcat 4.1.12 and jsp(of course) and trying to secure my web pages with session and other authentication stuff. i am statically including a header.jsp page at the top of every page to handle session management, ie check for valid or invalid session, etc, and handle redirection accordingly. i use response.sendRedirect(...)
As long as the session is not expired, everything works fine, but as soon as it expires, any redirection gives IllegalStateException and i can't do anything about it.
Please give me some suggesstions on how to fix this problem or point me to a different mechanism
Thanks,
Alex
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex
The problem isn't with the session making the include not work it is with the include itself. The send redirect method will throw an IllegalStateException if the response has already been commited. More than likely, you are using the jsp:include action which writes the included file directly to the out object.
Try using the include directive (@include) this is a translation time include and should fix your problem.
hope that helps
 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing is it only happens when the session is already expired, not before.
i am using the static includes for my headers, that seems to work exactly as expected, just the after the session is expired, its thowing the exception.
Alex
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!