java - How can I use Spring 3.2.3 JavaConfig to read an environment variable? -


i trying use spring 3.2.3 release javaconfig in app , need read value of environment variable.

i have read javaconfig 1.0.0.m4 documentation seems need cannot find how import or resolve referenced @environmentvaluesource or @externalvalue annotations.

can show me how please? thanks.

you should able use @value annotation spel expression retrieve environmental variable systemenvironment properties object, e.g.:

@value("#{ systemenvironment['my_property'] }") private string myproperty; 

if need system properties, use systemproperties['my_property'] instead.

additionally, documentation should looking @ here - have linked quite old.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -