jetty with spring MVC session.isNew() returns always false
I am running Jetty 9.3 with Spring MVC and Spring Security. My main page is intercepted by Spring Security Login page which is in JSP. The problem is with my SessionTimeoutIntercepter which should redirect in case of session timeout. What I want to do when the session is timed out - redirect to Spring Security Login page with some parameter like "Session expired". The problem is that session.isNew() which I use always returns false((( I tried with mapping to *"/**"* - the same result. Even after my first request to server and login page - this function returns false((( Can somebody help me why?
but method getSession() return new session if it not exists yet. You need getSession(false) - it don't create new session, just return null if it doesn't exists or return old session with timeout expired.
In your case, you can add some logic to interceptor