constructor-arg, property relation in spring

Posted on 2011-05-04
Last Modified: 2012-05-11
I was reading following lines and I did not understand clearly.

Notice that <constructor-arg> can take a <ref> element just like <property> does.
In fact, you can use any of the same sub elements you used with <property> in the
same way when setting constructor arguments with <constructor-arg>.

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
Question by:gudii9
    LVL 92

    Accepted Solution

    its just saying you can pass beans to your constructor wiring in exactly the same way you pass then to your setter
    LVL 7

    Author Comment

    >> exactly the same way you pass then to your setter

    i do not see any where setter in above description. you mean property. please advise
    LVL 92

    Expert Comment

    properties are set using setter methods

    public void setBlah(MyBean blah) {
       this.blah = blah);

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    noX challenge 17 54
    stringclean challenge 26 43
    What is JNDI datasource in spring 1 20
    pairs challenge 5 31
    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    This video teaches viewers about errors in exception handling.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now