springboot多线程的时候怎么用request?
木司冷雨剑 2018-03-21 09:45:56 现在是在代码里新开一个线程,然后新开的线程取不到request和session的东西,报下面的错误,要怎么解决?
Caused by: 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.