后端-框架-Spring-IoC-多种类型注入
<?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
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
<bean id="entity" class="entity.TestEntity">
<property name="specialCharacter1">
<value><![CDATA[P&G]]></value>
</property>
<property name="specialCharacter2">
<value>P&G</value>
</property>
<property name="innerBean">
<bean class="entity.User">
<property name="username">
<value>Mr. Inner</value>
</property>
</bean>
</property>
<property name="list">
<list>
<value>足球</value>
<value>篮球</value>
</list>
</property>
<property name="array">
<list>
<value>足球</value>
<value>篮球</value>
</list>
</property>
<property name="set">
<set>
<value>足球</value>
<value>篮球</value>
</set>
</property>
<property name="map">
<map>
<entry>
<key>
<value>football</value>
</key>
<value>足球</value>
</entry>
<entry>
<key>
<value>basketball</value>
</key>
<value>篮球</value>
</entry>
</map>
</property>
<property name="props">
<props>
<prop key="football">足球</prop>
<prop key="basketball">篮球</prop>
</props>
</property>
<property name="emptyValue">
<value></value>
</property>
<property name="nullValue">
<null/>
</property>
</bean>
</beans>