更改spring Web应用程序的默认会话超时

我必须测试一个由spring和jsp编写的Web应用程序。 应用程序的默认会话超时为30分钟。

我想减少会话超时。 为此,我在tomcatInstallationLocation/conf/中的web.xml文件中进行了tomcatInstallationLocation/conf/ 。 但它不起作用。 tomcatInstallationLocation/conf/web.xml的默认配置是 –

  30  

我刚刚改变时间并做到了 –

  5  

但仍然不起作用。 据我所知,在这种情况下,我必须在spring应用程序的web.xml进行更改。 但我不确定。 谁能帮我?

提前致谢。

会话超时层次:

  • $tomcat_home/conf/web.xml
  • $your_webapp/WEB-INF/web.xml
  • 手动调用HttpSession.setMaxInactiveInterval(int)

每个后续条目都会覆盖上面的其他条目。