title: How to get the property value inside a spring bean class in my class ?
body: <p>The things I did are:</p>
  
  <ul>
  <li>Created a property file (data.properties).</li>
  <li>Created a Spring.xml (I use property placeholder)</li>
  <li>Created a bean class.</li>
  <li>I have a class where I have to use the url value.</li>
  <li>I have a web.xml which has context-param where i set the param value to the path of the Spring.xml file.</li>
  <li>My codes are given below:</li>
  </ul>
  
  <blockquote>
    <p>Propertyfile:url=sampleurl</p>
    
    <p>Spring.xml:</p>
  </blockquote>
  
  <pre><code>&lt;bean
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
      &lt;property name="locations" value="classpath*:data.properties*"/&gt;
  
  &lt;/bean&gt;
  
  &lt;bean id="dataSource" class="org.tempuri.DataBeanClass"&gt;
      &lt;property name="url" value="${url}"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <blockquote>
    <p>beanclass</p>
  </blockquote>
  
  <pre><code>public class DataBeanClass extends PropertyPlaceholderConfigurer{
  private String url;
  
  public String getUrl() {
      return url;
  }
  
  public void setUrl(String url) {
      this.url = url;
  }
  }
  </code></pre>
  
  <blockquote>
    <p>entry in web.xml</p>
  </blockquote>
  
  <pre><code> &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;classpath*:Spring*.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>Now my problem is I dont know what method of PropertyPlaceholderConfigurer should I override and what should I do to  set the value of variable url such that I can call it from other classes using getproperty() method. </p>