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了

 
    
        org.springframework.web.context.request.RequestContextListener
    
   

 

你可能感兴趣的:(工作总结)