• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Mike London

referencing multiple objects from a Object.. How to set up reference in the beans.xml file

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Newbie here. Spending my first hour on the spring framework.
I was trying to add some references to some dependent classes to see how the framework works.
In my hello world object i would like to create a refernce to a car object and a engine object and a wheel object etc.. car engine and wheel objects are all contained in the hello world object.
Please feel to ask any information i may have left out.
appreciate any inputs.

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

<bean id="helloWorld" class="com.tutorialspoint.HelloWorld">
<property name="message" value="Hi there!"/>

<bean id="helloWorld" class="com.tutorialspoint.HelloWorld">
<property name="message" ref=”CarObj”/>

<bean id="CarObj" class="com.tutorialspoint.Car">
<ref id="wheel" class="com.tutorialspoint.Wheel">


Posts: 17347
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first. because you put beans.xml makes me think you are not using up to date materials. It has been years and years since people used that file name.

2) a bean tag can have as many constructor-arg and property tags as needed between the opening and closing of the bean tag


With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic