<Spring>读取多个Properties
时间:2015-05-18 13:12:56
收藏:0
阅读:134
由于在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)