0

In Spring 3.0 and higher it is possible to refer a property of another bean as below.

<bean id="a" class="A">
    <property name="list"
        value="#{b.list}"/>
</bean>

Is there a way I can refer property of another bean in Spring 2.5.1. Note that Spring Expression integrated after Spring 3.0

vin
  • 43
  • 6

1 Answers1

0

Spring is a framework for dependency injection and not for value injection. If your bean a has dependency on bean b for its creation, then why not inject the bean b in bean a.

Spring do give limited feature for injecting values but that is only for configuring the components i.e. beans.

Amit Bhati
  • 5,569
  • 1
  • 24
  • 45
  • There are instances where you cannot create bean B in Bean A but need to refer value. For example I need to inject a value to publishedEndpointUrl in below Entry in Applicationcontext. I cannot declare any bean inside in JAXWS endpoint. . I can do this with Spring version 3 and above with Spring Expression language. How to make this in Spring 2.5 is the question at hand ? – vin Aug 01 '15 at 11:15