Jboss 5.1会话超时不起作用

问题描述 投票:1回答:1

我正面临着使用Jboss 5.1服务器的同一问题,我的会话超时不起作用。我在deployers / jbossweb.deployer / web.xml中设置了上述步骤。此外,我尝试通过编程强制超时使用 - HttpSession.setMaxInactiveInterval(int秒)但仍然没有超时。

请建议/帮助......

java servlets jboss5.x session-timeout
1个回答
0
投票
HttpSession.setMaxInactiveInterval(0) 

如果将值设置为0,则会立即超时。

如果你想让会话闲置到60分钟,那么在60 * 60秒内指定

HttpSession.setMaxInactiveInterval(3600);

我认为你字面意思是呼叫HttpSession ......以上都不行。尝试下面,也让我知道你如何在web.xml中配置(粘贴您的问题中的配置。)

request.getSession(false).setMaxInactiveInterval(3600);

虽然您需要在运行JBOSS服务器时指定运行时参数,如下所示,为了执行此操作,请转到jboss-5.0.1.GA \ server \ default \ deploy,然后编辑名为properties-service.xml的xml文件并添加以下xml片段。

 // Set raw properties file style properties.

<attribute name="Properties">
        org.apache.catalina.STRICT_SERVLET_COMPLIANCE=false
</attribute>
© www.soinside.com 2019 - 2024. All rights reserved.