spring中使用字符串注入collection,如set/array

来源:互联网 发布:网购电影票软件 编辑:程序博客网 时间:2024/06/07 05:22

spring中使用字符串注入collection,如set
xxxx.properties里面配置

setstr=10.25.33.188:26379,10.25.27.13:26379

在xml中配置:

<bean id="setInConstruct" class="common.spring.ioc.set.SetInConstruct">        <constructor-arg index="0" value="#{'${setstr}'.split(',')}"/>        <constructor-arg index="1" value="123,456" />    </bean>

注意:spring el需要spring3.0以上版本才能使用

阅读全文
0 0
原创粉丝点击