• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Timeout redirection not working properly

 
Radhika Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Our application is a Struts based J2EE Application.We want to specify SessionTimeout as 45 Minutes.So I did this by adding Session-Config element in web.xml and set Session-timeout as 45.We want to redirect to different page when client tries to click on page after SessionTimeout.we added error pages for error codes 400,404,500,408 etc.Before ,We saw it throwing 500 error when session is timedout.So we added custom page to show when error is 500.But its not working as expected still its showing something as
<TD class="d1" NOWRAP error 500 server caught unhandled Exception.
Is it the right way that I used to redirect to SessionTimeout page when session is timed out?If so why its not working..?Need help..Its Urgent..
Thanks,
 
Rajasekar Kayamboo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also working on STRUTS application. For session timeouts and re-direction we always do that in the action class. The limitaion is that the user will not be automatically taken to the redirected page but only if he clicks any link/button after the timeout he will be redirected.
Sekar
 
Radhika Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We want the samething to happen like when user clicks after session timeout he should see new session Timeout page.Can you give me the code example like how you did it in action class?..
Thanks,
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just do
HttpSession session = request.getSession(false);
if session is null redirect to a session time out page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic