首页 > 编程语言 > 详细

<Spring>读取多个Properties

时间:2015-05-18 13:11:02      阅读:261      评论:0      收藏:0      [点我收藏+]

由于在spring的源码中可以看到的是,

String location = element.getAttribute("location");
if (StringUtils.hasLength(location)) {
String[] locations = StringUtils.commaDelimitedListToStringArray(location);
builder.addPropertyValue("locations", locations);
}

因此,在加载locations的时候,是以数组的形式加载的。

故在XML中配置的时候,可以使用逗号进行分割。

<context:property-placeholder location="classpath:jdbc.properties,abc.properties"/>

<Spring>读取多个Properties

原文:http://my.oschina.net/anyyang/blog/416070

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!