2
是否可以在春季制作@Aspect请求范围?因为它似乎不起作用,而且它有道理;代理对象实际上并未实际注入,建议仅由运行时应用。只是想知道...是否可以在春季制作@Aspect请求范围
例子:
@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
}
}
而且在XML:
<bean class="MyAspect" scope="request" />
你想要做什么? – Cygnusx1
@ Cygnusx1:用例子编辑的问题 – Kevin