users@jersey.java.net

[Jersey] Re: Decoding URI into path parameters

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Fri, 15 Apr 2011 18:49:23 -0700 (PDT)

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.