java - How to inject a Spring bean id into another Spring Configured Bean? -


i want able pass bean id bean reference. if have this:

<bean id="specialname" class="my.specialbean"/> <bean id="referencebean" class="my.referencebean">     <property name="refid" value="<specialname.name>"/> </bean> 

public class referencebean {      // spring injected value of should 'specialname'             public string refid;      // getter & setter refid } 

the reason need this, referencebean route builder in camel , directs messages specialbean through spring registry. i'm new spring , camel, if ill conceived questions, apologies.

you can use spring-el -

<bean id="specialname" class="my.specialbean"/> <bean id="referencebean" class="my.referencebean">     <property name="refid" value="#{specialname.name}"/> </bean> 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -