On 4/20/06, Jared Rypka-Hauer <[EMAIL PROTECTED]> wrote:
> <bean id="Verity" class="model.util.VerityController" singleton="true">
>         <constructor-arg name="collection">
>                 <value>${Constants.get("verityCollection")}</value>
>         </constructor-arg>
> </bean>
> <bean id="Constants" class="model.util.Collection" singleton="true">
>         <constructor-arg name="values">
>                 <map>
>                         <entry key="verityCollection">
>                                 <value>ci</value>
>                         </entry>
>                 </map>
>         </constructor-arg>
> </bean>

Somewhat surprisingly, the following works:

<bean id="Verity" class="model.util.VerityController" singleton="true">
       <constructor-arg name="collection">
               <ref bean="collectionName"/>
       </constructor-arg>
</bean>
<!-- THIS BEAN IS REALLY NOT A BEAN, IT'S A STRING!! -->
<bean id="collectionName" factory-bean="Constants" factory-method="get">
        <constructor-arg name="name">
                <value>verityCollection</value>
        </constructor-arg>
</bean>
<bean id="Constants" class="model.util.Collection" singleton="true">
       <constructor-arg name="values">
               <map>
                       <entry key="verityCollection">
                               <value>ci</value>
                       </entry>
               </map>
       </constructor-arg>
</bean>
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Reply via email to