aspose file tools*
The moose likes JSP and the fly likes redirecting to some sessionExpired.jsp after sessiontimeout? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "redirecting to some sessionExpired.jsp after sessiontimeout?" Watch "redirecting to some sessionExpired.jsp after sessiontimeout?" New topic
Author

redirecting to some sessionExpired.jsp after sessiontimeout?

pavan mandala
Greenhorn

Joined: Jun 06, 2008
Posts: 5
Dear all,

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

Thanks in advance
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

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


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Please read this for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pavan mandala
Greenhorn

Joined: Jun 06, 2008
Posts: 5
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

Joined: Jun 06, 2008
Posts: 5
My jsp's have ajax code to fetch some data from server.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: redirecting to some sessionExpired.jsp after sessiontimeout?
 
Similar Threads
Control after redirecting
Content Filtering
Redirect the page after some time? very urgent!
java.lang.IllegalStateException: Response already committed
control after redirecting