<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="address" class="com.zxw.pojo.Address"></bean>
<bean id="student" class="com.zxw.pojo.Student">
<!-- 第一种注入 普通值注入 name value-->
<property name="name" value="张馨文"></property>
<!-- 第二种注入 bean注入 name ref-->
<property name="address" ref="address"></property>
<!-- 数组注入 -->
<property name="books">
<array >
<value>红楼梦</value>
<value>西游记</value>
<value>三国演义</value>
</array>
</property>
<!-- list注入-->
<property name="hobbys">
<list>
<value>听歌</value>
<value>写代码</value>
</list>
</property>
<!-- map注入-->
<property name="card">
<map>
<entry key="身份证" value="1111111111111111111"></entry>
<entry key="银行卡" value="22222222222222222"></entry>
</map>
</property>
<!-- set注入-->
<property name="games">
<set>
<value>LOL</value>
<value>COC</value>
<value>BOB</value>
</set>
</property>
<!-- null值注入-->
<!-- <property name="wife" value=""/>-->
<property name="wife">
<null/>
</property>
<!-- properties注入-->
<property name="info">
<props>
<prop key="学好">202009070155</prop>
<prop key="性别">男</prop>
</props>
</property>
</bean>
<import resource="beans.xml"></import>
</beans>