Hi Jim,

On Apr 13, 2009, at 7:56 PM, Jim Alateras wrote:

> I am currently using s custom class to attach routes to  a router but
> am now looking at using the SpringBeanRouter but have a couple of
> questions.
>
> 1.  In the example below if i also want to support the a query string
> would i change the bean name to  "/studies?{query}"

You should set the bean name to whatever you were formerly passing to  
Router#attach.

> 2. How do i specify a default route for the router.

This isn't directly supported at the moment.  The easiest thing to do  
right now is to subclass SpringBeanRouter and override  
postProcessBeanFactory something like this:

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory  
factory) {
   super.postProcessBeanFactory(factory);
   this.attachDefault(createFinder("theDefaultResourceBeanName"))
}

Rhett

> <beans .. >
>   <bean name="router" class="org.restlet.ext.spring.BeanNameRouter"/>
>   <bean name="/studies" id="studiesResource" autowire="byName"
> scope="prototype" class="edu.northwestern.myapp.StudiesResource" >
> </beans>
>
> cheers
> </jima>
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1699583

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

Reply via email to