Spring課程 Spring入門篇 5-3 配置切入點 pointcut

課程連接:java

1    解析spring

1.1  xml常見的配置切入點寫法express

2    代碼演練ide

2.1  xml配置切入點url

 

 

 

1    解析spa

1.1  xml常見的配置切入點寫法.net

 

 

 

 

 

2    代碼演練code

2.1  xml配置切入點xml

xml配置:對象

<?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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">


<bean id = "logAspect" class = "com.imooc.aop.schema.advice.LogAspect"></bean>
<bean id = "AspectBiz" class = "com.imooc.aop.schema.advice.biz.AspectBiz"></bean>

<aop:config>
    <aop:aspect id="moocAspectAOP" ref="logAspect">
<!-- 聲明切入點:從哪裏開始執行--> <!-- 執行com.imooc.aop.schema.advice.biz包下的全部Biz結尾的java類中的全部方法時 -->
        <aop:pointcut expression="execution(*com.imooc.aop.schema.advice.biz.*Biz.*(..))" id="moocPointCut"/>
    </aop:aspect>
</aop:config>

</beans>

 

切入面:

package com.imooc.aop.schema.advice; public class MoocAspect { }

 

切入對象:

package com.imooc.aop.schema.advice.biz; public class AspectBiz { }
相關文章
相關標籤/搜索