java.lang.IllegalStateException: No thread-bound request found, exception in aspect

前端 未结 5 1219
不知归路
不知归路 2021-02-02 08:20

Following is my aspect:

    @Configurable
    @Aspect
    public class TimingAspect {

        @Autowired
        private HttpServletRequest httpServletRequest;
         


        
5条回答
  •  青春惊慌失措
    2021-02-02 08:58

    As the error message said: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

    To fix it, register a RequestContextListener listener in web.xml file.

    
       
        
            org.springframework.web.context.request.RequestContextListener
        
       
    
    

提交回复
热议问题