Java SpringAspect-如何使我的自定义Aspect通过SpringEL访问方法参数?

Java SpringAspect-如何使我的自定义Aspect通过SpringEL访问方法参数?,java,spring,annotations,spring-aop,Java,Spring,Annotations,Spring Aop,我想通过EL访问方法参数,就像PreAuthorize访问应用它的方法参数一样 例如: @PreAuthorize("#contact.name == authentication.name") public void doSomething(Contact contact); 我想为我的自定义方面做类似的事情 @MyAspect("#contact.name") public void doSomething(Contact contact); 有没有办法通过Spring AOP实现这

我想通过EL访问方法参数,就像PreAuthorize访问应用它的方法参数一样

例如:

@PreAuthorize("#contact.name == authentication.name")
public void doSomething(Contact contact);
我想为我的自定义方面做类似的事情

 @MyAspect("#contact.name")
 public void doSomething(Contact contact);
有没有办法通过Spring AOP实现这一点?

正如您在中看到的,注释中应该只有一个
value()
属性。这应该得到一个EL表达式

然后,您可以了解如何解析EL表达式