Java 澄清Spring上下文:属性占位符本地重写用法
我正在使用一个本地重写来指定一个属性,并希望确认这只适用于applicationContext中指定的属性。基本上我想确保这不会有任何意外的后果Java 澄清Spring上下文:属性占位符本地重写用法,java,spring,Java,Spring,我正在使用一个本地重写来指定一个属性,并希望确认这只适用于applicationContext中指定的属性。基本上我想确保这不会有任何意外的后果 <context:property-placeholder properties-ref="defaultProperties" location="classpath:my.properties" ignore-resource-not-found="true" ignoreunresolvable="true"
<context:property-placeholder
properties-ref="defaultProperties"
location="classpath:my.properties"
ignore-resource-not-found="true"
ignoreunresolvable="true"
local-override="true"/>
<util:properties id="defaultProperties">
<prop key="some.property">${overriding.property}</prop>
</util:properties>
${overriding.property}
除${some.property}之外的任何属性都不会被覆盖,是吗?除${some.property}之外的任何属性都不会被以下代码覆盖:
<context:property-placeholder properties-ref="defaultProperties" location="classpath:my.properties, "ignore-resource-not-found="true" ignoreunresolvable="true" local-override="true"/>
<bean id="defaultProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<util:properties local-override="true">
<prop key="some.property">${overriding.property}</prop>
</util:properties>
</property>
${overriding.property}