title: loading properties file in spring
body: <p>One of our team has implemented loading properties this way (see pseudo code below) and advises this approach is right as the client application using this is free to keep the properties in any file. Contrary to the widely used propertyplaceholderconfigurer.</p>
  
  <h2>application-context.xml</h2>
  
  <pre><code>&lt;bean class="com.mypackage.Myclass"&gt;
  &lt;property name="xml" value="classpath:"{com.myapp.myproperty1}"&gt; &lt;/property&gt; 
  &lt;/bean&gt;
  </code></pre>
  
  <p>config.properties</p>
  
  <pre><code>com.myapp.myproperty1=data.xml
  </code></pre>
  
  <p>edit: I should have added it is data.properties and not data.xml. We want to load a property file (this property file is given in the config.properties as a "property".
  com.myapp.myproperty1=data.properties</p>
  
  <h2>java class</h2>
  
  <pre><code>import org.springframework.core.io.Resource;
  public class Myclass {
  
  private Resource xmlField;
  
  // setter &amp; getter methods..
  
  }
  </code></pre>
  
  <p>Is it right to use spring core.io.Resource?</p>
  
  <p>Another reason is the client application wants to load a environment specific configuration. I suggested use the propertyconfigurer and use maven profiles to generate the environment specific build</p>
  
  <p>Can you please advise which one suits which case? and if it differs in different scenarios,  please help me point out them?</p>
  
  <p>thanks</p>