English

How To: Increase the session timeout for Java Connector Web applications

Summary

Steps to increase the timeout value of the servlet engine for a Web application by editing the application's web.xml file.

Procedure

The web.xml file is the application deployment descriptor of the Web application. Information contained in this file is specific to the individual application and can be modified to meet its needs.

To increase the default session timeout value for the application:

  1. Navigate to the application's web.xml file and open in a text editor.

    Note:
    This is usually located in the application's \WEB-INF directory.

    Windows : <drive>:\yourWebApp\WEB-INF\web.xml
    UNIX: ../yourWebApp/WEB-INF/web.xml


  2. Insert the following code between the tags <wep-app></wep-app>.

    Code:
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>


    Note:
    The value 30 is the timeout in minutes. Use a value appropriate for the Web application.


    Note:
    Some Web server/servlet engine combinations may impose the order of elements contained within the web.xml file. Refer to the document type descriptor (dtd) used in the application's web.xml file (eg. http://java.sun.com/j2ee/dtds/web-app_2_2.dtd) for the order of elements.

  3. Save and close the file.
  4. Restart the Web server/servlet engine.

    Note:
    For some Web server/servlet engine combinations you may need to re-deploy the Web application.