Aspect运行良好,但为什么方法joinPoint.getArgs()返回null? 是什么原因?怎么解决? 独立版本可以正常工作,但使用Jetty时总是返回null。我使用Spring 3.2,Spring Security。
In config Spring: <aop:aspectj-autoproxy/>
@Validated
public interface Service {
public String update(Long userId, String name);
}
@Service("myService")
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ServiceImpl implements Service {
@MyAnnotation
@Override
public String update(Long userId, String name) {
//...
}
}
@Aspect
@Component
public class MyAspect {
@Around("@annotation(annotation)")
public Object myAround(ProceedingJoinPoint joinPoint, MyAnnotation annotation) throws Throwable {
Object[] args = joinPoint.getArgs();
args = null!
}
}