setConfigLocations(configLocations)对应源码

public void setConfigLocations(@Nullable String... locations) {
	if (locations != null) {
		Assert.noNullElements(locations, "Config locations must not be null");
		this.configLocations = new String[locations.length];
		for (int i = 0; i < locations.length; i++) {
			this.configLocations[i] = resolvePath(locations[i]).trim();
		}
	}
	else {
		this.configLocations = null;
	}
}

protected String resolvePath(String path) {
	return getEnvironment().resolveRequiredPlaceholders(path);
}

源码的注释其实写得比较明了,一句话概括了:设置此应用程序上下文的配置位置,如果未设置,则实现可酌情使用默认值。

06-13 08:23