• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Expired session gives illegal state exception

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic