【发布时间】:2012-10-21 04:06:12
【问题描述】:
我想转义我的 Spring 属性文件以获取我的 bean 属性:${ROOTPATH}/relativePath
我有一个简单的 Spring 配置文件,其中包含:
<context:property-placeholder location="classpath:myprops.properties" />
<bean id="myBean" class="spring.MyBean">
<property name="myProperty" value="${myproperty}" />
</bean>
myprops.properties 包含:
myproperty=\${ROOTPATH}/relativePath
上述设置返回:无法解析占位符“ROOTPATH”。我尝试了很多可能的语法,但无法找到正确的语法。
【问题讨论】:
-
一年没有任何评论。您解决了这个问题吗?
标签: spring properties escaping curly-braces