1
我正嘗試與AOP取得聯繫。因此,我寫了一個小小的世界,但它不能按我的意願工作。AOP Aspect在使用關鍵字「after」之前的給定方法之前執行?
在aspect中我使用關鍵字「after」,但是如果調用給定的方法,「aspect」 - 方法在連接點之前執行!?有誰知道爲什麼?
其他任何工作正常! (沒有例外!)
<bean id="myAspectBean" class="hello.world.MyAspect">
</bean>
<bean id="helloBean" class="hello.world.Hello">
<property name="first" value="Hello"/>
<property name="second" value="World!"/>
</bean>
<aop:config>
<aop:aspect ref="myAspectBean">
<aop:pointcut id="pc" expression="execution(* sayHello(..))"/>
<aop:after pointcut-ref="pc" method="doit" />
</aop:aspect>
</aop:config>