The idref element allow you to pass the bean id (which is the string value not the reference) of another bean in the container to a <property/> or <constructor-arg/>. In the given example it is clearly shown how pass the bean id to another bean and also display the bean id.
FirstBean.java
package idref.example;
|
AnotherBean.java
package idref.example;
|
IDREFMain.java
package idref.example;
|
context.xml
<bean id="first" class="idref.example.FirstBean"> |
first
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.