I get the session MaxInactiveInterval time using the following query. I am developing web application using JSF Framework
var sessionMaxInactiveTime = ${pageContext.session.maxInactiveInterval};
I need to set maxInactiveInterval.
how to set maxInactiveInterval using JavaScript, JQuery, or to write Servlet.
But i want to control to main template jsp Page.
Is available any links, notes or samples?
Help me. Thanks in advance.
I get the session MaxInactiveInterval time using the following query. I am developing web application using JSF Framework
var sessionMaxInactiveTime = ${pageContext.session.maxInactiveInterval};
I need to set maxInactiveInterval.
how to set maxInactiveInterval using JavaScript, JQuery, or to write Servlet.
But i want to control to main template jsp Page.
Is available any links, notes or samples?
Help me. Thanks in advance.
Share Improve this question asked Jul 12, 2010 at 2:52 EswarEswar 2934 gold badges15 silver badges28 bronze badges 01 Answer
Reset to default 2In doPost or doGet method in your servlet, first get Session object and call setMaxInactiveInterval() method on Session. You can similarly get session object & set max inactive interval (by calling setMaxInactiveInterval() method) from your JSP page.
Below is servlet example:
// Get the current session object, create one if necessary
HttpSession session = req.getSession();
// Set the timeout
session.setMaxInactiveInterval(2*60*60); // two hours
You can find similar and more examples related to Servlet and sessions here :http://www.java2s./Tutorial/Java/0400__Servlet/ServletSessionMaxInactiveInterval.htm