<?xml version="1.0" encoding="UTF-8"?>
<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"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<!--目标对象-->
<bean id="target" class="com.itliu.aop.Target"></bean>
<!--切面对象-->
<bean id="myAespect" class="com.itliu.aop.MyAespect"></bean>
<!-- 配置织入:告诉Spring框架哪些方法需要进行哪些增强-->
<aop:config>
<!-- 声明切面-->
<aop:aspect id="myAespect" ref="myAespect">
<aop:pointcut id="myPointcut" expression="execution(public void com.itliu.aop.Target.*())"/>
<!-- 切面:切点+通知(增强)-->
<!-- <aop:before method="before" pointcut="execution(public void com.itliu.aop.Target.*())"></aop:before>-->
<!-- <aop:after method="after" pointcut="execution(public void com.itliu.aop.Target.*())"></aop:after>-->
<!-- <aop:around method="around" pointcut="execution(public void com.itliu.aop.Target.*())"></aop:around>-->
<!-- -->
<aop:before method="before" pointcut-ref="myPointcut"></aop:before>
</aop:aspect>
</aop:config>
</beans>