I've been assuming stuff and seeing that now it's not correct. I have the following configuration properties declaration in my spring context :
<bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="searchContextAttributes" value="true" />
<property name="contextOverride" value="true" />
<property name="locations">
<list>
<value>classpath:/app.properties</value>
</list>
</property>
</bean>
I thought values from app.properties
would override my system properties so I would be able to acess them directly in my Java classes like this :
String someThingFromPropertyFile = System.getProperty("nameFromPropertyFile");
And of course I get null pointer exceptions all over the place. Now I'm here to ask how to access your application properties from you application (Java classes part of your application).
Is there a better way than this below (I'm not saying it's bad).