有个需求须要读取服务器本地配置文件,实现代码以下便可:redis
xmlns:context="http://www.springframework.org/schema/context" <context:property-placeholder location="classpath:redisServer.properties,file:/home/.settings/redisServer.properties" ignore-resource-not-found="true" />
使用file读取本地。配置文件同名便可。spring会默认使用最后加载的配置文件。注意是覆盖配置文件里的key。spring