Hello Vlatko,

I think you must change the matching mode of the "subscriptions route: 
can you try with "Template.MODE_EQUALS " instead of 
"Template.MODE_STARTS_WITH"?

best regards,
Thierry Boileau

> Thanks Thierry!
>
> This was really useful.
> I managed to get it running, although there are still a couple of questions.
>
> So I do the following:
> // Attach subscriptions resource.
> Route subscriptionsRoute = 
> router.attach("/rms/channels/{topicPath}/subscriptions", 
> SubscriptionsResource.class);
>         
> subscriptionsRoute.getTemplate().setMatchingMode(Template.MODE_STARTS_WITH);
> Map<String, Variable> subscriptionsRouteVariables = 
> subscriptionsRoute.getTemplate().getVariables();
>         subscriptionsRouteVariables.put("topicPath", new 
> Variable(Variable.TYPE_ALL));
>         
> // Attach channel resource.
> Route channelRoute = router.attach("/rms/channels/{topic}", 
> ChannelResource.class);
>         channelRoute.getTemplate().setMatchingMode(Template.MODE_EQUALS);
> Map<String, Variable> channelRouteVariables = 
> channelRoute.getTemplate().getVariables();
> channelRouteVariables.put("topic", new Variable(Variable.TYPE_ALL));
>
> And here are the questions:
> 1. For some reason, I have to have the route for the subscriptions before the 
> route for the channels.
> 2. The subscriptions route handles only if the URL does not end with "/", 
> i.e. if I have something like: /channels/floor1/room101/subscriptions 
> everything works well, and the SubscribtionsResource is used, however if I 
> use /channels/floor1/room101/subscriptions/ in the URL, then everything goes 
> forwarded to the ChannelsResource.
>
> Any ideas how to fix this?
>
> Thanks!
> Vlatko
>
>

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

Reply via email to