Announcement Announcement Module
Collapse
No announcement yet.
Pass parameter value / aop:after-returning Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 10:48 PM.

  • #2
    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) {...

    Comment

    Working...
    X