本文主要是介绍no thread-bound request found:are you referring to request,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题描述:
通过webservice接口调用程序时,发现在执行查询的时候一直报一个错误,错误信息如下:
java.lang.IllegalStateExceptino: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......
解决方法:
在web.xml文件中配置这句话就ok了
<listener><listener-class>org.springframework.web.context.request.RequestContextListener</listener-class></listener>
这篇关于no thread-bound request found:are you referring to request的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!