2012-10-05 3 views
1

나는 AOP와 접촉하려고하고있다. 그러므로 나는 작은 helloworld를 썼다. 그러나 그것이 내가 원하는만큼 일하지 않는다.AOP Aspect는 키워드 "after"를 사용해도 주어진 메소드보다 먼저 실행됩니까?

"after"키워드를 사용하지만 주어진 메소드가 호출되면 joinpoint보다 먼저 "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> 

답변

1

나는 단지 didnt 한 디버그 ..

가 출력 버퍼링, 그래서 텍스트가 앞에 오는에 "Hello World!"하지만, 방법은 나중에라고 ..

관련 문제