Following is my aspect:
@Configurable
@Aspect
public class TimingAspect {
@Autowired
private HttpServletRequest httpServletRequest;
With your pointcut expression, you're basically proxying every bean and applying that advice. Some beans exist and operate outside the context of an HttpServletRequest
. This means it cannot be retrieved.
You can only inject the HttpServletRequest
in places where a Servlet container request handling thread will pass through.