标签:property class info 场景 pre value component http jdk
Spring AOP面向切面编程
Spring依赖注入:
通过构造器注入
1.根据索引
2.根据name
3.根据类型
List Set 数组 对象 资源文件
<bean id="OtherBean" class="cn.itsource._01mybean.OtherBean"></bean>
<bean id="ListMyBean" class="cn.itsource._01mybean.ListMyBean">
<!--<property name="arrays" value="1,2,3"></property>-->
<property name="arrays">
<array>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
</array>
<!--注入list集合-->
</property>
<property name="list">
<list>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
<value>钟尚华</value>
</list>
</property>
<!--注入otherBeanList对象类型的集合-->
<property name="otherBeanList">
<list>
<bean class="cn.itsource._01mybean.OtherBean"></bean>
<bean class="cn.itsource._01mybean.OtherBean"></bean>
<bean class="cn.itsource._01mybean.OtherBean"></bean>
</list>
</property>
<!--注入Set集合-->
<property name="set">
<set>
<value>睡神皮政1</value>
<value>睡神皮政2</value>
<value>睡神皮政3</value>
<value>睡神皮政4</value>
<value>睡神皮政</value>
<value>睡神皮政</value>
</set>
</property>
<!--注入otherBeanset对象类型的集合-->
<property name="otherBeanSet">
<set>
<bean class="cn.itsource._01mybean.OtherBean"></bean>
<bean class="cn.itsource._01mybean.OtherBean"></bean>
<ref bean="OtherBean"></ref>
<ref bean="OtherBean"></ref>
<ref bean="OtherBean"></ref>
</set>
</property>
<!--注入map-->
<property name="mp">
<map>
<entry key="1" value="睡神皮大哥"></entry>
<entry key="2" value="睡神皮大哥"></entry>
<entry key="3" value="睡神皮大哥"></entry>
<entry key="4" value="睡神皮大哥"></entry>
<entry key="5" value="睡神皮大哥"></entry>
</map>
</property>
<!--注入property资源文件 支持中文-->
<property name="prop1">
<props>
<prop key="root1">皮大哥睡觉叫不醒</prop>
<prop key="root2">皮大哥睡觉叫不醒</prop>
<prop key="root3">