这里只贴出XML
1
<?
xml version="1.0" encoding="UTF-8"
?>
2
<!
DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
3
"http://www.springframework.org/dtd/spring-beans.dtd"
>
4
<
beans
>
5
<!--
分散配置
-->
6
<
bean
id
="jdbc"
7
class
="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
8
<
property
name
="locations"
>
9
<
list
>
10
<
value
>
jdbc.properties
</
value
>
11
<
value
>
temp.properties
</
value
>
12
</
list
>
13
</
property
>
14
</
bean
>
15
16
<!--
自定义属性编辑器配置器
-->
17
<
bean
id
="customEditorConfigurer"
class
="org.springframework.beans.factory.config.CustomEditorConfigurer"
>
18
<
property
name
="customEditors"
>
19
<
map
>
20
<
entry
key
="com.sigon.spring.service.Address"
>
21
<
bean
class
="com.sigon.spring.editor.AddressEditor"
></
bean
>
22
</
entry
>
23
</
map
>
24
</
property
>
25
</
bean
>
26
<!--
国际化
-->
27
<
bean
id
="messageSource"
class
="org.springframework.context.support.ResourceBundleMessageSource"
>
28
<
property
name
="basenames"
>
29
<
list
>
30
<
value
>
jdbc
</
value
>
31
</
list
>
32
</
property
>
33
</
bean
>
34
<!--
注册监听者
-->
35
<!--
<bean id="applistener" class="com.sigon.spring.listener.MyApplicationListener"/>
-->
36
<!--
目标对象
-->
37
<
bean
id
="welcomeServiceTarget"
class
="com.sigon.spring.service.WelcomeServiceImpl"
>
38
<
property
name
="greeting"
>
39
<
value
>
TOM
</
value
>
40
</
property
>
41
</
bean
>
42
<!--
方法前通知
-->
43
<
bean
id
="myMethodBeforeAdvice"
class
="com.sigon.spring.aop.MyMethodBeforeAdvice"
/>
44
<!--
方法后通知
-->
45
<
bean
id
="myAfterReturningAdvice"
class
="com.sigon.spring.aop.MyAfterReturningAdvice"
/>
46
<!--
环绕通知
-->
47
<
bean
id
="myMethodInterceptor"
class
="com.sigon.spring.aop.MyMethodInterceptor"
/>
48
<!--
代理对象
-->
49
<
bean
id
="welcomeService"
class
="org.springframework.aop.framework.ProxyFactoryBean"
>
50
<
property
name
="proxyInterfaces"
>
51
<
list
>
52
<
value
>
com.sigon.spring.service.WelcomeService
</
value
>
53
<
value
>
com.sigon.spring.service.WelcomeService2
</
value
>
54
</
list
>
55
</
property
>
56
<
property
name
="interceptorNames"
>
57
<
list
>
58
<
value
>
myMethodBeforeAdvice
</
value
>
59
<
value
>
myAfterReturningAdvice
</
value
>
60
<
value
>
myMethodInterceptor
</
value
>
61
</
list
>
62
</
property
>
63
<
property
name
="target"
>
64
<
ref
bean
="welcomeServiceTarget"
/>
65
</
property
>
66
<!--
以类继承方式
-->
67
<!--
<property name="proxyTargetClass">
-->
68
<!--
<value>true</value>
-->
69
<!--
</property>
-->
70
</
bean
>
71
72
<!--
<bean id="welcomeSpring" class="com.sigon.spring.service.WelcomeSpring" autowire="byType">
-->
73
<!--
<constructor-arg type="java.lang.String">
-->
74
<!--
<value>123</value>
-->
75
<!--
</constructor-arg>
-->
76
<!--
<constructor-arg type="java.lang.Integer">
-->
77
<!--
<value>456</value>
-->
78
<!--
</constructor-arg>
-->
79
<!--
<property name="homeAddress">
-->
80
<!--
<value>jilin.changchun.chunchengdajie.130022</value>
-->
81
<!--
</property>
-->
82
<!--
<property name="comAddress">
-->
83
<!--
<bean class="com.sigon.spring.service.Address">
-->
84
<!--
<property name="province">
-->
85
<!--
<value>${province}</value>
-->
86
<!--
</property>
-->
87
<!--
<property name="city">
-->
88
<!--
<value>${city}</value>
-->
89
<!--
</property>
-->
90
<!--
<property name="street">
-->
91
<!--
<value>${street}</value>
-->
92
<!--
</property>
-->
93
<!--
<property name="zipCode">
-->
94
<!--
<value>${zipcode}</value>
-->
95
<!--
</property>
-->
96
<!--
</bean>
-->
97
<!--
</property>
-->
98
<!--
<property name="prop">
-->
99
<!--
<props>
-->
100
<!--
<prop key="key1">werouiq</prop>
-->
101
<!--
<prop key="key2">ewlirzj;g</prop>
-->
102
<!--
<prop key="key1">dsruifqweuio</prop>
-->
103
<!--
</props>
-->
104
<!--
</property>
-->
105
<!--
<property name="welcome">
-->
106
<!--
<value>${jdbc.username}</value>
-->
107
<!--
</property>
-->
108
<!--
<property name="map">
-->
109
<!--
<map>
-->
110
<!--
<entry key="key1">
-->
111
<!--
<value>skycn</value>
-->
112
<!--
</entry>
-->
113
<!--
<entry key="key1">
-->
114
<!--
<value>diablo</value>
-->
115
<!--
</entry>
-->
116
<!--
<entry key="key3">
-->
117
<!--
<ref bean="byeService"/>
-->
118
<!--
</entry>
-->
119
<!--
<entry key="key4">
-->
120
<!--
<value>Blizzard</value>
-->
121
<!--
</entry>
-->
122
<!--
<entry key="key5">
-->
123
<!--
<list>
-->
124
<!--
<value>123</value>
-->
125
<!--
<value>456</value>
-->
126
<!--
<value>789</value>
-->
127
<!--
</list>
-->
128
<!--
</entry>
-->
129
<!--
<entry key="key6">
-->
130
<!--
<bean class="com.sigon.spring.service.ByeService">
-->
131
<!--
<property name="bye">
-->
132
<!--
<value>UC</value>
-->
133
<!--
</property>
-->
134
<!--
</bean>
-->
135
<!--
</entry>
-->
136
<!--
</map>
-->
137
<!--
</property>
-->
138
<!--
<property name="list">
-->
139
<!--
<list>
-->
140
<!--
<value>tom</value>
-->
141
<!--
<value>tom</value>
-->
142
<!--
<value>jetta</value>
-->
143
<!--
<value>1</value>
-->
144
<!--
<value>1</value>
-->
145
<!--
<value>2</value>
-->
146
<!--
<value>2.5</value>
-->
147
<!--
<bean class="com.sigon.spring.service.ByeService">
-->
148
<!--
<property name="bye">
-->
149
<!--
<value>KKK</value>
-->
150
<!--
</property>
-->
151
<!--
</bean>
-->
152
<!--
<ref bean="byeService"/>
-->
153
<!--
<list>
-->
154
<!--
<value>123</value>
-->
155
<!--
<value>456</value>
-->
156
<!--
<ref bean="byeService"/>
-->
157
<!--
</list>
-->
158
<!--
</list>
-->
159
<!--
</property>
-->
160
<!--
<property name="is">
-->
161
<!--
<list>
-->
162
<!--
<value>1</value>
-->
163
<!--
<value>1</value>
-->
164
<!--
<value>2</value>
-->
165
<!--
</list>
-->
166
<!--
</property>
-->
167
<!--
<property name="set">
-->
168
<!--
<set>
-->
169
<!--
<value>123</value>
-->
170
<!--
<value>456</value>
-->
171
<!--
<value>asdi</value>
-->
172
<!--
<bean class="com.sigon.spring.service.ByeService"></bean>
-->
173
<!--
<ref bean="byeService"/>
-->
174
<!--
</set>
-->
175
<!--
</property>
-->
176
<!--
</bean>
-->
177
<!--
<bean id="byeService" class="com.sigon.spring.service.ByeService" init-method="init">
-->
178
<!--
<property name="bye">
-->
179
<!--
<value>bye!!!</value>
-->
180
<!--
</property>
-->
181
<!--
</bean>
-->
182
<!--
<bean id = "myBeanPostProcessor" class="com.sigon.spring.process.MyBeanPostProcessor"></bean>
-->
183
184
</
beans
>

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184
