title: Loading properties from a file AND system properties using Spring
body: <p>Searched through some other posts but could not find exactly what I needed, but I would guess this is an easy question..</p>
  
  <p>So I have a property file called myprops.properties</p>
  
  <pre><code>myprops.localProp1=localProp1
  myprops.localProp2=localProp2
  myprops.systemProp=${systemPropertyName}
  </code></pre>
  
  <p>Basically, in this property file I want to use the values as is for localProp1 and locapProp2 but for systemProp, I would like to load the system property.  Let's assume that the system property is always set.</p>
  
  <p>My spring config xml looks like this...</p>
  
  <pre><code>&lt;bean id="myprops" class="org.springframework.beans.factory.config.PropertiesFactoryBean"&gt;
      &lt;qualifer value="myprops" /&gt;
      &lt;property name="singleton" value="true"/&gt;
      &lt;property name="ignoreResourceNotFound" value="true" /&gt;
      &lt;property name="locations"&gt;
          &lt;list&gt;&lt;value&gt;classpath:myprops.properties&lt;/value&gt;&lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I use the qualifier have this bean autowired and use the qualifier string "myprops" to access it in another class.  All the expected values are there except the myprops.systemProp, it still = ${systemPropertyName}.</p>
  
  <p>How would I get this property to be resolved with the actual system property?</p>
  
  <p>I tried the following in my spring config:</p>
  
  <pre><code>&lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
      &lt;property name="properties" ref="myprops" /&gt;
      &lt;property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This didn't seem to help..</p>
  
  <p>Any ideas?  I'm hoping this is an easy one and I am just misunderstanding a common concept in property configuration.  </p>
  
  <p>Note: I had to manually type all the code couldn't copy/paste so please excuse typos.</p>
  
  <p>Thanks.</p>