Hi all,
Michael, if you don't want to introduce redundancy in your URI templates,
you can also use a hierarchy of routers, or maybe use String constants to
compose the URI templates.
Concerning your {id} variable, it is possible to make it match any URI
character.
Template template = router.attach("/{foo}/{bar}/{baz}/{id}",
myCustomFinder).getTemplate();
template.getVariables().put("id", new Variable(Variable.TYPE_URI_ALL));
Best regards,
Jerome
> -----Message d'origine-----
> De : Rhett Sutphin [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 4 février 2008 20:17
> À : [email protected]
> Objet : Re: template question
>
> Hi,
>
> On Feb 4, 2008, at 12:21 PM, Stephan Koops wrote:
> > Hello Michael,
> >> and most importantly:
> >>
> >> /a/b/c/1/x/y/z resulting in foo=a,bar=b,baz=c,id=1/x/y/z
> >>
> > I've had the problem with "1/x/y/z" in the JAX-RS
> extension. Take a
> > look to the constructor in projekt org.restlet.ext.jaxrs
> (see trunk
> > in repository), class org.restlet.ext.jaxrs.impl.PathRegExp. It's
> > some weeks ago, that I impemented it, so I can't tell every detail
> > by head. But feel free to ask.
>
> By my reading, this sort of expansion violates the URI Template
> specification draft (
> http://bitworking.org/projects/URI-Templates/draft-gregorio-ur
itemplate-02.txt
> ). See section 3.1:
>
> The value of every non-list variable, and the individual values in
> list variables, must come from ( unreserved / pct-encoded ).
>
> "Unreserved" here is defined by RFC 3986, section 2.3:
>
> unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
>
> It seems like it might be possible to get a result like "id=1/x/y/z"
> using the listjoin template operator, but I don't know if restlet
> supports that.
>
> Rhett