aspose file tools*
The moose likes JSP and the fly likes page timeout 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 "page timeout" Watch "page timeout" New topic
Author

page timeout

Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
I am trying the following code to timeout a specific JSP. But it is not working.

<%
HttpSession hsObj = request.getSession();
hsObj.setMaxInactiveInterval(50);
%>

It is in the header(starting point of the JSP). Is there another setting that will supercede this expire request???

May be Bear can help me on this.


Kishore
SCJP, blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

You cannot timeout a specific JSP. What requirement are you trying to achieve?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
Originally posted by Bear Bibeault:
You cannot timeout a specific JSP. What requirement are you trying to achieve?


Basically I need to timout the user session.

Main usage is in the login/registration screens. Scenario is that user enters some info on the registration(could be some sensitive stuff) and gets busy with other issues in life. If the user has not done any activity on the screen for about 20 minutes in the above screens, we need to timeout the session and inform the user to enter all the info again.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

So why not just set the session timeout to 20 minutes in the config file?
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
we already have 30 minutes for the session sitting on other pages. 20 minutes is the requirement for these specific pages.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Then you'll have to do with a client-side Javascript timeout. There is no way to specify different session timeouts for different pages since they all share the same session.
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
what happens say we set to 20 minutes in web.xml??

If the user is sitting on initial registration page and was idle for 20 minutes after last entry, he will see a error page??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page timeout
 
Similar Threads
script time out & page time out in JSP
Redirect before Session Timeout
how to call another jsp
redirecting to some sessionExpired.jsp after sessiontimeout?
session values