is it possible to make a @Aspect request scope in spring-Collection of common programming errors
is it possible to make a @Aspect request scope in spring? Because it seems that it doesn’t work, and it kind of makes sense; the proxy object isn’t actually injected anywhere, the advice is just applied by the runtime. Just wondering…
Example:
@Aspect
public class MyAspect {
// expecting this to get autowired per request
@Autowired private HttpServletRequest request;
@Around(...)
public void doSomething(ProceedingJoinPoint pjp) {
// something here
pjp.proceed();
// something there
}
}
And in XML: