开发者

How does Jboss Timeout works?

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 happ开发者_开发技巧ened?


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>


The HttpSession timeout in JBoss can be set at three different levels:

  • #1 To change default timeout value for every web application:

Edit the Web Deployer's default wed application configuration: in the web.xml

<session-config>
   <session-timeout>30</session-timeout>
</session-config>
  • #2 To override the default 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)>

  • #3 To override the global and web app value for a single client,

call

HttpSession.setMaxInactiveInterval(int seconds)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜