Rhett, Thanks for the quick turnaround and suggestions
On 14/04/2009, at 2:19 PM, Rhett Sutphin wrote: > 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. At the moment my custom class does something like this router.attach("/resource?{query}", this.resourceMap.get(uri)) .getTemplate().getVariables().put("query", new Variable( Variable.TYPE_URI_QUERY, "", false, false)); will this still work? > > >> 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")) > } > excellent > 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 cheers </jima> ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1704873