봄에 @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