我们可以将属性值作为对另一个属性值的引用

时间:2013-09-20 09:32:52

标签: xml spring properties

我的应用程序中有两个属性文件1)config-default.properties 2)velocity.properties,两个属性值都相同,如

在文件1中,我有:

context.config.path = opt/htdocs/docroot/content

在文件2中,我有:

file.context.path = opt/htdocs/docroot/content

现在,由于这两个属性具有相同的值,我想给出文件1的键(名称)的名称,作为对文件2的属性值的引用,如:

file.context.path =${context.config.path}

但是我没有看到它出现在那里,我通过appContext.xml以这种方式加载config.properties文件:

<context:property-placeholder
    location="classpath:config-common-default.properties,classpath:config-default.properties,classpath:config.properties"
    ignore-unresolvable="true" ignore-resource-not-found="true"/>

任何人都可以帮助我。

0 个答案:

没有答案