为了账号安全,请及时绑定邮箱和手机立即绑定

为啥我的前置通知出现了好几次的?

<bean id="testBeforeAdvice" class="com.spirng.java.aop.service.api.TestBeforeAdvice"></bean>
<bean id="testAfterReturningAdvice" class="com.spirng.java.aop.service.api.TestAfterReturningAdvice"></bean>
<bean id="testThrowAdvice" class="com.spirng.java.aop.service.api.TestThrowAdvice"></bean>
<bean id="testMethodInterceptor" class="com.spirng.java.aop.service.api.TestMethodInterceptor"></bean>

<bean id="logServiceImplTarget" class="com.spirng.java.aop.service.api.impl.LogServiceImpl"></bean>

<bean id="pointcutBean" class="org.springframework.aop.support.NameMatchMethodPointcut">
    <property name="mappedNames">
        <list>
            <value>ad*</value>
        </list>
    </property>
</bean>

<bean id="defaultAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
    <property name="advice" ref="testBeforeAdvice"></property>
    <property name="pointcut" ref="pointcutBean"></property>
</bean>

<bean id="logServiceImpl" class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="target" ref="logServiceImplTarget"></property>
    <property name="interceptorNames" >
        <list>
            <value>testBeforeAdvice</value>
            <value>testAfterReturningAdvice</value>
            <value>testThrowAdvice</value>
            <value>testMethodInterceptor</value>
        </list>
    </property>
</bean>

TestBeforeAdvice:com.sun.proxy.$Proxy14  add
TestBeforeAdvice:com.sun.proxy.$Proxy11  add
TestMethodInterceptor1:java.lang.reflect.Method add
TestBeforeAdvice:com.spirng.java.aop.service.api.impl.LogServiceImpl  add
LogServiceImpl>>>>>>>>>>000000000
TestMethodInterceptor2:null
TestAfterReturningAdvice:com.sun.proxy.$Proxy11  add  null


正在回答

举报

0/150
提交
取消

为啥我的前置通知出现了好几次的?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信