spring aop:
<aop:config proxy-target-class="true">
<aop:advisor advice-ref="testAdvice" pointcut="execution(* com..*.Waiter.greetTo(..))"/> // testAdvice: implements MethodBeforeAdvice
<aop:aspect ref="adviceMethods"> //adviceMethods里面存在preGreeting 方法
<aop:pointcut id="greetToPointcut"
expression="target(com.brianway.learning.spring.aop.aspectj.NaiveWaiter) and execution(* greetTo(..))"/>
<aop:before method="preGreeting" pointcut-ref="greetToPointcut"/>
</aop:aspect>
</aop:config>
转载于:https://www.cnblogs.com/eryun/p/7400668.html