On 11/6/07, Jerome Louvel <[EMAIL PROTECTED]> wrote:
>
> Hi Alex,
>
> Thanks for sharing all the details.
>
> 1) For the root attachment issue, you can use this approach instead:
>
> // To match only URIs that are strictly equal to "/"
> Template template = router.attach("/", rootRestlet).getTemplate();
> template.setMatchingMode(Template.MODE_EQUALS);
>
> // To match all other URIs
> router.attach("/", everythingElseRestlet);
>
> 2) For the mapping of URIs with a ".js" extension to a resource you can do:
>
> Template template = router.attach("/{foo}.js").getTemplate();
> template.setMatchingMode(Template.MODE_EQUALS);
> template.getDefaultVariable().setType(TYPE_URI_ALL);
>
>   or
>
> template.getVariables().put("foo", new Variable(TYPE_URI_ALL));
>
> Does that cover all your needs or am I still missing something ?

That certainly provides a way for my current set of patterns.

This all needs to be better documented in both how to use the API to
accomplish this and the fact that the specification for URI templates mentions
nothing about matching semantics.  As such, restlet.org should have
such a specification somewhere.

--Alex Milowski

Reply via email to