3

My Spring app use fully java based configs (Spring version is 4, Spring Security version is 3.2.3).

My initializer class extends AbstractAnnotationConfigDispatcherServletInitializer and there I put all my @Configuration classes.

The question is how to define session timeout if I don't use web.xml?

Thanks

Alex Fruzenshtein
  • 2,846
  • 6
  • 32
  • 53
  • You cannot use java based configuration to, globally, set the session timeout. This is one of the omissions in the java based configuration approach to the servlet context. The same goes for error-pages, display-name and a few others. This might be corrected in Servlet 3.2 or 4.0. As a workaround you could use a `HttpSessionListener` implementation to set the timeout per session. – M. Deinum May 05 '14 at 12:36

1 Answers1

1

Adding to the above comment by M. Deinum, such an example is available at:

Controlling session timeout using an HttpSessionListener

Regards

Amarjeet Singh
  • 121
  • 1
  • 2
  • 1
    Providing a link in the answer is ok if you provide enough information from the link as the link might not always work. – VPK Jan 29 '18 at 09:04