users@jersey.java.net

[Jersey] Re: Decoding URI into path parameters

From: Daniel Larsson <daniel.j.larsson_at_gmail.com>
Date: Sat, 16 Apr 2011 10:41:52 +0200

There's also
http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/core/ResourceContext.html,
to turn your URI into a resource reference without you parsing the URI.

2011/4/16 Gili <cowwoc_at_bbs.darktech.org>

> Answering my own question:
>
> http://www.nakov.com/blog/2009/07/15/jax-rs-path-pathparam-and-optional-parameters/
>
> Gili
>
>
> Gili wrote:
> >
> > Hi again,
> >
> > How do I tell Jersey to parse any URL that starts with the following
> > string?
> >
> > http://host.com/resources/{id}
> >
> > That is, I'd want:
> >
> > http://host.com/resources/1
> >
> > to match with {id} = 1
> >
> > but I'd also want
> >
> > http://host.com/resources/1/bar/5
> >
> > to match with {id} = 1. What template string should I be using? Am I
> > forced to use two separate templates?
> >
> > Thanks,
> > Gili
> >
> >
> > Martin Matula-3 wrote:
> >>
> >> On 17.3.2011 14:27, Gili wrote:
> >>> Martin Matula-3 wrote:
> >>>> You can use path parameter instead of a particular hostname, like
> this:
> >>>> UriTemplate ut = new
> >>>> UriTemplate("http://
> {host}/context/jersey/books/{id}/page/{pageNum}");
> >>
> >
>
>
>
> --
> View this message in context:
> http://jersey.576304.n2.nabble.com/Decoding-URI-into-path-parameters-tp6167750p6278134.html
> Sent from the Jersey mailing list archive at Nabble.com.
>