setMaxInactiveInterval(int seconds) will work for a specific user
session timeout. It is set in the httpsession object, for example
http://bit.ly/g2WdSW.
In Struts 2 you can gain access to the HttpSession object by accessing
HttpServletRequest
(http://struts.apache.org/2.0.14/docs/how-can-we-access-the-httpservletrequest.html)
and then calling getSession()
setMaxInactiveInterval will override the global timeout for the
application, which can be set in web.xml. You can configure global
session timeout in web.xml. It's a Java web specification parameter, not
struts 2 specific:
<webapp>
.
.
<session-config>
<session-timeout>10</session-timeout> <!-- 10 minutes -->
</session-config>
.
.
</webapp>
On 28/12/2010 6:45, ashutosh kumar wrote:
How can I set session timeout at runtime for struts 2. Does
HttpSession.setMaxInactiveInterval work? If yes ,where do I need to set it?
Thanks
Ashutosh
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org