【问题标题】:How to pass multiple parameter in Spring 3.0 AOP Advice method (@Before) using annotation?如何使用注释在 Spring 3.0 AOP Advice 方法(@Before)中传递多个参数?
【发布时间】:2011-06-23 08:59:15
【问题描述】:

我正在准备 Spring AOP 演示应用程序。我被卡住了。 我的查询是.. 如何在 Spring 3.0 AOP Advice 方法(@Before)中使用注解传递多个参数?

【问题讨论】:

    标签: spring-aop


    【解决方案1】:

    来自http://static.springsource.org/spring/docs/2.5.x/reference/aop.html 查看第 6.2.4.6.2 节

    您可以通过以下方式传递参数

    @Before("com.xyz.myapp.SystemArchitecture.dataAccessOperation() &&" + 
            "args(account,..)")
    public void validateAccount(Account account) {
      // ...
    }
    

    【讨论】:

      猜你喜欢
      • 2012-05-11
      • 1970-01-01
      • 2013-05-13
      • 1970-01-01
      • 1970-01-01
      • 2018-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多