This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirecting to some sessionExpired.jsp after sessiontimeout?

 
pavan mandala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

Can anyone post code for redirecting a jsp to some sessionexpired.jsp after session timeout urgently ??

Thanks in advance
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pavan mandala:
Dear all,

Can anyone post code for redirecting a jsp to some sessionexpired.jsp after session timeout urgently ??

Thanks in advance


We cannot do it urgently. You need to elaborate on your requirement. Based on that this can be a solution from a JS or a container. JSPs should not redirect
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this for more information.
 
pavan mandala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our application was developed using only servlets and jsp. If user accesses a jsp and leaves the web page without closing and if he tries to access the page after session timeout time defined in web.xml, Im getting a javascript error "unknown runtime error" . Can anyone tell how to handle this?
 
pavan mandala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My jsp's have ajax code to fetch some data from server.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pavan mandala:
My jsp's have ajax code to fetch some data from server.


Post the exception here and give us a more detailed version of your problem to attract better responses
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The approach I take, is to bind an object (say "userBean") to session when the user logs in. With each request, check for the existence of userBean in session. If it is not there (null), forward or redirect to a session expired page.

Filters make it easy to add this functionality to an existing application without needing to add code to every component.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic