p; init-method="init" destroy-method="destory"><!-- 静态工厂获取bean --></bean> <bean id="fac" class="com.persia.PersonServiceBeanInsFactory"></bean><bean id="personService3" factory-bean="fac" factory-method="createInstance" scope="prototype"><!-- 实例工厂获取bean,先实例化工厂再实例化bean--></bean> <!-- ref方式注入属性 --><bean id="personDao" class="com.persia.PersonDaoBean"></bean><bean id="personService4" class="com.persia.PersonServiceBean"> <property name="personDao" ref="personDao"></property></bean> <!-- 内部bean方式注入 --><bean id="personService5" class="com.persia.PersonServiceBean"> <property name="personDao"> <bean class="com.persia.PersonDaoBean"></bean> </property> <property name="name" value="persia"></property> <property name="age" value="21"></property> <property name="sets"> <!-- 集合的注入 --> <set> <value>第一个</value> <value>第二个</value> <value>第三个</value> </set> </property> <property name="lists"> <!-- 集合的注入 --> <list> <value>第一个l</value> <value>第二个l</value> <value>第三个l</value> </list> </property> <property name="properties"> <props> <prop key="key1">value1</prop> <prop key="key2">value2</prop> <prop key="key3">value3</prop> </props> </property> <property name="map"> <map> <entry key="key1" value="value-1"></entry> <entry key="key2" value="value-2"></entry> <entry key="key3" value="value-3"></entry> </map> </property></bean> <bean id="personService6" class="com.persia.PersonServiceBean"> <constructor-arg index="0" value="构造注入的name" ></constructor-arg> <!-- 基本类型可以不写ty