<Spring>读取多个Properties

原创
2015/05/18 09:58
阅读数 190

由于在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"/>

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
7 收藏
0
分享
返回顶部
顶部