Spring配置集合列表
程序员文章站
2022-03-10 13:45:07
...
Spring配置集合列表
参考:http://blog.csdn.net/wit_tang/article/details/51513186
注意要添加 schema/util
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"> <bean id="CustomerBean" class="com.yiibai.common.Customer"> <property name="lists"> <util:list list-class="java.util.ArrayList"> <value>one</value> <value>2</value> <value>three</value> </util:list> </property> </bean> </beans>