Reputation: 13585
Is there any way to access any -D option value (JVM Option) in Spring's applicationContext.xml?
I am accessing Apache Camel Context through Spring's applicationContest.xml and separate out my routes or camelContexts based -Denv="preprod".
Upvotes: 2
Views: 3600
Reputation: 21000
If you have a property-placeholder configured you can access the system properties using ${env}
.
If you are using spring 3.0 or higher you can use the spring expression language support (Spel) - #{systemProperties.env}
Upvotes: 1