1 <!-- 配置切面bean --> 2 <bean id="permAspect" class="com.tx.spring.aspect.PermAspect"></bean> 3 4 <bean id="userService" class="com.tx.spring.service.impl.UserServiceImpl"></bean> 5 6 <aop:config> 7 <!-- 配置切点 --> 8 <aop:pointcut expression="execution(* com.tx.spring.service..*.*(..))" id="mycut"/> 9 <!-- 配置切面 --> 10 <aop:aspect ref="permAspect"> 11 <aop:before method="preAspect" pointcut-ref="mycut"/> 12 <aop:after method="afterAspect" pointcut-ref="mycut"/> 13 <!-- 返回通知 --> 14 <aop:after-returning method="returnAdvice" pointcut-ref="mycut" returning="returnval"/> 15 <!-- 环绕通知 --> 16 <aop:around method="aroundAdvice" pointcut-ref="mycut" /> 17 </aop:aspect> 18 </aop:config>