diff --git a/spring-framework-reference/src/beans-dependencies.xml b/spring-framework-reference/src/beans-dependencies.xml index 2f56f948b0b..f3cd4ba5970 100644 --- a/spring-framework-reference/src/beans-dependencies.xml +++ b/spring-framework-reference/src/beans-dependencies.xml @@ -158,6 +158,22 @@ public class ExampleBean { has two arguments of the same type. Note that the index is 0 based. + +
+ Constructor argument name + + As of Spring 3.0 you can also use the constructor parameter + name for value disambiguation: + + <bean id="exampleBean" class="examples.ExampleBean"> +<constructor-arg name="years" value="7500000"/> +<constructor-arg name="ultimateanswer" value="42"/> +</bean> + + Keep in mind that your code has to be compiled with the debug + flag enabled so that Spring can lookup the parameter name from the + constructor. +