0

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!
    }
}
4

0 回答 0