我AOP配置 <aop:aspectj-autoproxy/>
<bean id="myBefore" class="com.test.aop.GetStartEnd"></bean>
<aop:config>
<aop:aspect id="abcd" ref="myBefore">
<!-- <aop:pointcut id="myPointcut" expression="execution(* com.abc.ebook.service.impl.*.*(..))"/> -->
<aop:pointcut id="myPointcut" expression="execution(* com.abc.ebook.dao.impl.*.*(..))"/>
<aop:before pointcut-ref="myPointcut" method="aa"/>
<aop:after pointcut-ref="myPointcut" method="bb"/>
</aop:aspect>
</aop:config>
因为MyBatis的DAO层是没有实现类的,调试的时候也发现,压根就没有进入impl包的方法里面,
所以以上配置不起效果,但是我要在这一层进行拦截啊,需要对每个方法的前后切入一些逻辑,我该怎么做呢?AOP
<bean id="myBefore" class="com.test.aop.GetStartEnd"></bean>
<aop:config>
<aop:aspect id="abcd" ref="myBefore">
<!-- <aop:pointcut id="myPointcut" expression="execution(* com.abc.ebook.service.impl.*.*(..))"/> -->
<aop:pointcut id="myPointcut" expression="execution(* com.abc.ebook.dao.impl.*.*(..))"/>
<aop:before pointcut-ref="myPointcut" method="aa"/>
<aop:after pointcut-ref="myPointcut" method="bb"/>
</aop:aspect>
</aop:config>
因为MyBatis的DAO层是没有实现类的,调试的时候也发现,压根就没有进入impl包的方法里面,
所以以上配置不起效果,但是我要在这一层进行拦截啊,需要对每个方法的前后切入一些逻辑,我该怎么做呢?AOP
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货