Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
setting property of one bean using property of other bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • setting property of one bean using property of other bean

    Hi,

    I am new to Spring Framework, and I need help implementing the following scenario using Spring core Framework.
    I have 2 classes Class A and Class B. Class A has an ArrayList of Class B and Class B contains the properties of class A.

    I would really appreciate if someone could help me on this. Also please point me to the resources where I can find the solution for the same.

    Thanks & Regards
    Harish

  • #2
    Hi,

    I guess you will have a lot more chances of getting answers if you post the same question in the following forum :
    http://forum.springframework.org/viewforum.php?f=4

    Comment


    • #3
      Take a look at chapter 3 of the spring reference documention for details on how to define something like that in a Spring application context (http://static.springframework.org/sp...nce/beans.html).

      You would end up with something like this:
      Code:
      <bean id="a" class="A">
         <property name="bList">
            <list>
               <ref bean="b0"/>
               <ref bean="b1"/>
            </list>
         </property>
      </bean>
      
      <bean id="b0" class="B">
         <property name="prop" value="foo"/>
      </bean>
      <bean id="b1" class="B">
         <property name="prop" value="bar"/>
      </bean>
      Erwin

      Comment


      • #4
        Hi,

        Thanks a lot everyone for your help.

        Regards
        Harish

        Comment

        Working...
        X