I have a JAVA web application which runs on Tomcat Server. I have a setup a property in my tomcat's VM arguments; something like -Denvironment =“E1”.
I want to read that property inside my app.properties file, I tried mutiple options like ${environment} and {sys:environment} but could not able to read the value.
Please help, thanks in advance.
你也可以试试这个:
${sys:environment}
It all depends on the class you are using to load your properties, because Java dont support this.
If you try with
${sys:environment}
You should use Commons-Configuration
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.