<aop:config>
<!-- 配置多个切点,&& || ! -->
<aop:pointcut id="pc" expression="execution(public * com.wtas.*.service.*.*(..)) || execution(public * com.wtas.*.*.service.*.*(..)) || execution(public * com.wtas.*.*.*.service.*.*(..))" />
<aop:advisor pointcut-ref="pc" advice-ref="userTxAdvice" />
</aop:config>
其中,&&,||,可以写成and,or,但是需要注意大小写,我在讲||换成大写的OR的时候,不能进行事务控制,不知道是不是区别别大小写的。
还有一种做法,就是写多个aop:advisor:
<aop:advisor pointcut="execution(public * com.wtas.*.service.*.*(..))" advice-ref="userTxAdvice" />
<aop:advisor pointcut="execution(public * com.wtas.*.*.service.*.*(..))" advice-ref="userTxAdvice" />