1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <beans xmlns =" http://www.springframework.org/schema/beans"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xmlns : context =" http://www.springframework.org/schema/context"
5+ xmlns : aop =" http://www.springframework.org/schema/aop"
6+ xsi : schemaLocation =" http://www.springframework.org/schema/beans
7+ http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
8+ http://www.springframework.org/schema/context
9+ http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd" >
10+
11+ <bean id =" student123"
12+ class =" io.kimmking.spring01.Student" >
13+ <property name =" id" value =" 123" />
14+ <property name =" name" value =" KK123" />
15+ </bean >
16+
17+ <bean id =" student100"
18+ class =" io.kimmking.spring01.Student" >
19+ <property name =" id" value =" 100" />
20+ <property name =" name" value =" KK100" />
21+ </bean >
22+
23+ <bean id =" class1" class =" io.kimmking.spring02.Klass" >
24+ <property name =" students" >
25+ <list >
26+ <ref bean =" student100" />
27+ <ref bean =" student123" />
28+ <bean class =" io.kimmking.spring01.Student" >
29+ <property name =" name" value =" qq" />
30+ <property name =" id" value =" 001" />
31+ </bean >
32+ </list >
33+ </property >
34+ </bean >
35+
36+
37+ <context : component-scan base-package =" io.kimmking.spring02" />
38+
39+
40+ <bean id =" aop1" class =" io.kimmking.spring02.Aop1" />
41+
42+ <bean id =" aop2" class =" io.kimmking.spring02.Aop2" />
43+
44+ <aop : aspectj-autoproxy proxy-target-class =" true" />
45+ <!-- <aop:aspectj-autoproxy />-->
46+
47+ <aop : config >
48+ <aop : pointcut expression =" execution(* io.kimmking.aop.*.*(..))" id =" p1" /> <!-- 切点-->
49+ <aop : aspect ref =" aop1" > <!-- 切面 -->
50+ <aop : around method =" around" pointcut-ref =" p1" />
51+ <aop : before method =" startTransaction" pointcut-ref =" p1" /> <!-- 前置通知-->
52+ <aop : after-returning method =" commitTransaction" pointcut-ref =" p1" /> <!-- 后置通知-->
53+ </aop : aspect >
54+ </aop : config >
55+
56+ <!-- <context:annotation-config />-->
57+ <!-- -->
58+ <bean id =" school" class =" io.kimmking.spring02.School" ></bean >
59+
60+
61+ </beans >
0 commit comments