Himanshu Yadav
Himanshu Yadav

Reputation: 13585

Access JVM options in Spring's Application Context xml

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

Answers (1)

gkamal
gkamal

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

Related Questions