![](/img/trans.png)
[英]Spring - “context:property-placeholder” - property priority
[英]Clarifying Spring context:property-placeholder local-override usage
我正在使用本地替代來指定屬性,並想確認這僅適用於applicationContext中指定的屬性。 基本上我想確保這不會有任何意外的后果...
<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>
除$ {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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.