Hi Jonathan,

I think there is a way in Spring to inject a property of a bean
("application.context"), but I can't remember how. 

Are there Spring experts reading?

Best regards,
Jerome  

> -----Message d'origine-----
> De : Jonathan Hall [mailto:[EMAIL PROTECTED] 
> Envoyé : vendredi 14 mars 2008 21:09
> À : [email protected]
> Objet : Context param with Directory in Spring
> 
> Hi,
> 
> I'm trying to serve static files using Directory in a Spring 
> way, but I have a problem when it comes to the Context param.
> 
> In http://restlet.tigris.org/issues/show_bug.cgi?id=334 Jerome wrote:
> 
> "Directory and other classes needing a Context param in 
> constructor should also
> accept a parent Restlet as well, directly in the API to 
> workaround the inability
> of Spring to inject a child property taken from another bean."
> 
> This was never implemented, was there another solution found? 
> I've tried searching but had no luck.
> 
> At the minute I have it working but extending Directory with:
> 
> public SpringDirectory( Restlet restlet, String rootUri )
> {
>     super( restlet.getContext(), rootUri );
> }
> 
> and using the spring config:
> 
> <bean class="com.blah.SpringDirectory">
>     <constructor-arg index="0" ref="application"/>
>     <constructor-arg index="1" value="clap://thread/static"/>
> </bean>
> 
> Any help appreciated,
> 
> jon
> 
> 

Reply via email to