Results 1 to 2 of 2

Thread: Pass parameter value / aop:after-returning

  1. #1

    Default Pass parameter value / aop:after-returning

    How do we pass parameter value(name) for the given configured method="testAOP(String name)" ?

    <aop:after-returning pointcut-ref="beanName" method="testAOP(String name)" />
    Last edited by springbeginners; Dec 14th, 2009 at 10:48 PM.

  2. #2
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

    Default

    6.3.3.2. After returning advice
    ...
    Just as in the @AspectJ style, it is possible to get hold of the return value within the advice body. Use the returning attribute to specify the name of the parameter to which the return value should be passed:

    Code:
    <aop:aspect id="afterReturningExample" ref="aBean">
    
        <aop:after-returning 
          pointcut-ref="dataAccessOperation"
          returning="retVal" 
          method="doAccessCheck"/>
              
        ...
        
    </aop:aspect>
    The doAccessCheck method must declare a parameter named retVal. The type of this parameter constrains matching in the same way as described for @AfterReturning. For example, the method signature may be declared as:

    Code:
    public void doAccessCheck(Object retVal) {...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •