我希望逃避我的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'。我尝试了很多可能的语法,但没有找到正确的方法。
${myproperty}
注入到myBean.myProperty
中,而不是${ROOTPATH}/relativePath
。 - t7tran#{ systemProperties['ROOTPATH'] }/relativePath
- user2428804