I have a need to have different properties base on the server.
i.e QA, preproduction, production A or production B, I can load a local properties file into jboss with this code in the properties-service.xml
<mbean code="org.jboss.varia.property.SystemPropertiesService" name="jboss:type=Service,name=SystemProperties"> <attribute name="URLList"> ./conf/local.properties </attribute> </mbean>
I can see them in the JMX view for the SystemPropertiesService. But how can I read them in my application?
Thanks in advance.
I had been trying:
String myProp = System.getenv("myProp");
but it wouldn't work.
My co-worker Aman just suggested:
String myProp = System.getProperty("myProp");
and it works great!