Reputation: 14387
How does timeout in jboss works? How does a web-app knows when to re-direct to a login page?
Just to clarify! -I know how to configure timeout on jboss. My question is, how does Jboss know that a session has timed out and when it does, how do you configure it to send the request to login page once the timeout has happened?
Upvotes: 4
Views: 4354
Reputation: 8395
The HttpSession
timeout in JBoss can be set at three different levels:
Edit the Web Deployer's default wed application configuration: in the web.xml
<session-config>
<session-timeout>30</session-timeout>
</session-config>
HttpSession
timeout on a per-webapp basis:Add the same tags as above to WEB-INF/web.xml
. Here is the DTD for further explanation:
<!--
The session-config element defines the session parameters for
this web application.
Used in: web-app
-->
<!ELEMENT session-config (session-timeout?)>
From https://developer.jboss.org/wiki/HttpSessionTimeout
The session-timeout element defines the default session timeout interval for all sessions created in this web application. The specified timeout must be expressed in a whole number of minutes. If the timeout is 0 or less, the container ensures the default behaviour of sessions is never to time out. Used in: session-config
<!ELEMENT session-timeout (#PCDATA)>
call
HttpSession.setMaxInactiveInterval(int seconds)
Upvotes: 1
Reputation: 68942
You can configure a time out on an all deployable units like .war files in web.xml
<session-config>
<session-timeout>30</session-timeout>
</session-config>
Upvotes: 2