【发布时间】:2019-03-01 02:21:00
【问题描述】:
我有一个需要使用的现有属性文件。在那里,我必须定义一个看起来像的新属性 - ${testText1}.${testText2}
我不希望编辑这些属性,即当我实际获取这些值时,我想要 ${testText1}.${testText2} 而不是替换值。
所以我的属性文件看起来像 -
someProperty=${testText1}.${testText2}
现在,当我拿到这个时:
@Value("${someProperty}")
私有字符串 myValue;
myValue 实际上应该包含字符串 - ${testText1}.${testText2} 而不是替换的值。
我该怎么做?
【问题讨论】:
标签: java spring properties properties-file