Hi,

On Aug 4, 2009, at 7:19 AM, [email protected] wrote:

> I'm using Spring and Restlet 1.2m2. Actually I have tow stupid  
> ServerResources who never interact with the rest of the app. But now  
> I have to write a ServerResource who want a "Service" and, of  
> course, I want to inject it with Spring but I'm unable to found any  
> integration samples for using "Spring managed resources".
>
> Actually I have the following Spring config :
> -- 8< ---------------------------------------
> <bean id="manager" class="web.services.rest.impl.restlet.RestManager">
>               <property name=""></property>
>               <property name="resourceMappings">
>                       <map>           
>                               <entry key="/form" 
> value="web.services.rest.impl.restlet.resources.FormsResource 
> " />
>                               <entry key="/form/{id}" 
> value="web.services.rest.impl.restlet.resources.FormResource 
> " />
>                               
>                               <entry key="/search/{object}" 
> value="web.services.rest.impl.restlet.resources.SearchResource 
> " />
>                       </map>
>               </property>
>       </bean>
>
> <bean id="searchService"  
> class="domain.services.search.SearchServiceImpl" />
> -- 8< ---------------------------------------
>
> And I want to pass "searchService" trought the constructor of "/ 
> search/{object}" resource.

There are several ways to do this.  Look through the Javadoc for the  
spring extension and find the one that suits you best:

http://www.restlet.org/documentation/2.0/jse/ext/org/restlet/ext/spring/package-summary.html

In particular, you'll probably want to take a look at SpringBeanRouter  
and SpringRouter.

Rhett

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2380994

Reply via email to