title: Create bean in spring context
body: <pre><code>&lt;bean id="configuration" class="com.mypackage.util.Configuration" factory-method="getInstance"&gt;
  &lt;property name="path" value="${path.props.app.dev}"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Then I have the following in my class</p>
  
  <pre><code>Configuration.getInstance();
  </code></pre>
  
  <p>Whereas the spring application context is loaded in another class Factory like this</p>
  
  <pre><code>private Factory() {
      context = new ClassPathXmlApplicationContext("META-INF/spring.xml");
  }
  </code></pre>
  
  <p>The problem is that before Factory class is accessed the context does not load and the configuration object gives null for path whereas when Factory is accessed and after that path property is accessed it gives the correct path.</p>
  
  <p>Please tell me how to do it correctly? That is how can i get my member variable path with correct data without accessing Factory class.</p>