Configuring Session Timeouts
The servlet descriptor file, web.xml, is used to configure a default value for session timeouts.
This file is generated for a project each time HydraExpress is run, and is located in your code generation directory under the generated
conf directory. The Agent’s servlet container uses the parameters in the service descriptor to launch the service at startup. For more information on this file, see
Servlet Configuration File: web.xml.
The session-config element defines characteristics of the sessions the container creates. A session-config element contains a session-timeout element. The session-timeout element sets the default timeout, in minutes, for sessions created by servlets within this context. The HydraExpress Agent deletes sessions that remain inactive longer than the timeout period.
To set a value for the session-timeout element, just add this element and a value to your service’s <servicecontextname>_web.xml file. For example, the code below configures the HydraExpress Agent to set a 15-minute timeout on sessions for all services in the context:
<web-app>
<servlet>
<servlet-name>MyService</servlet-name>
<servlet-class>rwsf_webservice_servlet.createMyService
,,,
</servlet>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
</web-app>
Servlets can also change the timeout on individual sessions.