aspose file tools
The moose likes JSP and the fly likes redirecting page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "redirecting page" Watch "redirecting page" New topic
Author

redirecting page

suman vasireddy
Greenhorn

Joined: Nov 17, 2008
Posts: 12
hi im new to session concept...i just want to redirect my page to login page after my session expires so please help me out how to do this in jsp....
Somesh Rathi
Ranch Hand

Joined: Apr 27, 2006
Posts: 31
Check for session timeout in JSP inside scriplet code (you can find relevant method to check for timeout in javadoc - getMaxInactiveInterval()) . In case session timeout/remain inactive for defined time interval , redirect it to login page using the sendredirect()of HTTPServletResponse.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56168
    
  13

Rather than putting Java code in scriptlets (a poor practice at this point) employ a servlet filter to do the check for you before any JSP is even invoked.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
jQuery in Action, 2nd edition
 
subject: redirecting page
 
Similar Threads
Session timoeout on JSP
include page ...problem
Checking session
redirecting useing session in jsp
Session Time out in JSP