users@jersey.java.net

[Jersey] Re: Decoding URI into path parameters

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Tue, 5 Apr 2011 16:31:51 -0700 (PDT)

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-tp6167750p6244170.html
Sent from the Jersey mailing list archive at Nabble.com.