How can I handle the session expired in spring MVC and what is the best place to handle it? where can I specify the session time out? It would be great if you could show me by some example.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For sessions timeout I am using ‘plain’ Servlet API.
Custom
javax.servlet.http.HttpSessionListenerdefined in web.xml and in methodsessionCreatedon session set timeout usingsetMaxInactiveInterval(in [s]).I know it is ‘old school’, but is simple and working for me.
If you want to get timeout value from spring, there is access to ServletContext from session.