Further to this, I have a couple of resources that are mapped to a 
Guard, or another Router.

router.attach("/webappcontext/auth", new Guard(getContext(), nextRestlet));

I'm having trouble mapping that too.  Is the rule of thumb usually to 
override something that is not quite working yet, like the default Route?

Thanks,
Dustin


Rhett Sutphin wrote:
> Hi Jim,
>
> On Apr 14, 2009, at 1:57 AM, Jim Alateras wrote:
>
>   
>> 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?
>>     
>
> Ah, I'm not familiar with that sort of construction.  I'm not sure if  
> it would work, though my guess is "no."  Can you try it and see?  If  
> it doesn't work, could you open an issue?
>
> Thanks,
> Rhett
>
>   
>>>       
>>>> 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
>>     
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1710897
>   

-- 


Dustin N. Jenkins | Tel/Tél: 250.363.3101 | dustin.jenk...@nrc-cnrc.gc.ca

facsimile/télécopieur: (250) 363-0045

National Research Council Canada | 5071 West Saanich Rd, Victoria BC. 
V9E 2E7

Conseil national de recherches Canada | 5071, ch. West Saanich, Victoria 
(C.-B) V9E 2E7

Government of Canada | Gouvernement du Canada

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

Reply via email to