java - redirect page to login page on session time out in spring mvc without using spring security -
It is easy to do this with spring security but what if I am not using Spring Security and in Spring MVC " The session expired "message with the user want to redirect the user to login.
Is this a specific method of spring?
Yes, you can use the following snippet. Try to include this line in the header of the page, change user attribute according to user session object.
Http session session = request.getSession ("user"); If (session! = Null & amp;; session.isNew ()) {// do something here} and {response.sendRedirect ("/ redirect_the_page.jsp"); }
Comments
Post a Comment