Zugriff auf HttpSession außerhalb des ursprünglich empfangenden Threads
Ich verwende Spring 3. Wenn der Controller Anforderungen erhält, übergibt er die Steuerung an die MethodesomeMethod()
kommentiert mit@Async
in Service Bean und kehrt dann zurück. Wenn ich in zugreifensomeMethod()
HttpSession-Objekt Ich erhalte diese Ausnahme
<code>java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request. </code>
Wie kann ich das beheben?