[关闭]
@tsing1226 2016-12-06T15:09:35.000000Z 字数 964 阅读 678

spring

spring集合(Lists、set、map和properties)


list示例

  1. <property name="lists">
  2. <list>
  3. <value>1</value>
  4. <ref bean="PersonBean" />
  5. <bean class="com.yiibai.common.Person">
  6. <property name="name" value="yiibaiList" />
  7. <property name="address" value="Hainan" />
  8. <property name="age" value="28" />
  9. </bean>
  10. </list>
  11. </property>

Set示例

  1. <property name="sets">
  2. <set>
  3. <value>1</value>
  4. <ref bean="PersonBean" />
  5. <bean class="com.yiibai.common.Person">
  6. <property name="name" value="yiibaiSet" />
  7. <property name="address" value="Hainan" />
  8. <property name="age" value="28" />
  9. </bean>
  10. </set>
  11. </property>

Map示例

  1. <property name="maps">
  2. <map>
  3. <entry key="Key 1" value="1" />
  4. <entry key="Key 2" value-ref="PersonBean" />
  5. <entry key="Key 3">
  6. <bean class="com.yiibai.common.Person">
  7. <property name="name" value="yiibaiMap" />
  8. <property name="address" value="Hainan" />
  9. <property name="age" value="28" />
  10. </bean>
  11. </entry>
  12. </map>
  13. </property>

Properties示例

  1. <property name="pros">
  2. <props>
  3. <prop key="admin">admin@yiibai.com</prop>
  4. <prop key="support">support@yiibai.com</prop>
  5. </props>
  6. </property>
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注