title: How to access data in another spring bean using current spring bean
body: <p>I am new to Spring and I have a small requirement. </p>
  
  <pre><code>&lt;bean name="triangle" class="com.thomson.learn.spring.triangle"&gt;
      &lt;property name="name" ref="dataSource" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="dataSource" class="java.lang.String"&gt;
      &lt;property name="name" value="easy" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I have written beans as shown above. I need to access the value <code>easy</code> from the bean with <code>id="triangle"</code>, but when I try doing this I get a exception. Can someone please suggest how to overcome this problem?</p>