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