This XML file does not appear to have any style information associated with it. The document tree is shown below.
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 配置目标对象 -->
<bean id="userService" class="com.spring.aop.service.UserServiceImpl"/>
<!-- 配置通知对象 -->
<bean id="myAdvice" class="com.spring.aop.advice.MyAdvice"/>
<!-- 配置切入 -->
<aop:config>
<!--
public void com.spring.aop.service.UserServiceImpl.add()
void com.spring.aop.service.UserServiceImpl.add()
* com.spring.aop.service.UserServiceImpl.add()
* com.spring.aop.service.UserServiceImpl.*()
* com.spring.aop.service.*ServiceImpl.*(..)
* com.spring.aop.service..*ServiceImpl.*(..)
-->
<!-- 配置切入点 -->
<aop:pointcut expression="execution(* com.spring.aop.service.*ServiceImpl.*(..))" id="pc"/>
<!-- 配置切面 切入点与增强的结合 -->
<aop:aspect ref="myAdvice">
<!-- 前置通知 -->
<aop:before method="before" pointcut-ref="pc"/>
<aop:after-returning method="afterReturn" pointcut-ref="pc"/>
<aop:around method="around" pointcut-ref="pc"/>
<aop:after-throwing method="afterException" pointcut-ref="pc"/>
<aop:after method="after" pointcut-ref="pc"/>
</aop:aspect>
</aop:config>
</beans>
评论区