I am using Jconfig for configuration. I am using XML and properties files. I have Jconfig.jar, properties file and xml file in classpath.
Properties file test.properties
:
app.site=xyz.com
XML file:
<properties>
<include properties="test.properties" />
<category name="test">
<app-site>${app.site}</app-site>
</category>
</properties>
In Java code use:
String site = config.getProperty("app-site", "test");
I am getting ouput as
${app.site}
No exception or error on console. What is wrong? Can anyone help please.
Cheers
尝试使用<property name="app-site" value="${app.site}">
代替<app-site>${app.site}</app-site>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.