一、依赖注入的三种注入方式
Spring框架为我们提供了三种注入方式:set注入、构造方法注入和接口注入。
1、set注入
1)普通字符类型注入
1 <bean id="" class=""> 2 <property name="" value=""/> 3 </bean>
2)对象注入
1 <bean id="" class=""> 2 <property name="" ref=""/> 3 </bean>
3)list集合注入
1 <bean id="" class=""> 2 <property name=""> 3 <list> 4 <value></value> 5 <value></value> 6 <value></value> 7 </list> 8 </property> 9 </bean>
4)属性文件中的字段的注入
2、
原文:http://www.cnblogs.com/lynujyq/p/5265849.html