You can try to declare a listener that provides the state necessary to implement the session scope:
<listener> <listener-class> org.springframework.web.context.request.RequestContextListener </listener-class> </listener>
By default, this state is displayed by the DispatcherServlet , so it is not available until the request enters the DispatcherServlet (for example, Spring Security Filters).
source share