users@jersey.java.net

[Jersey] Re: How to add query params to Ref annotation in jersey-server-linking

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Fri, 18 Mar 2011 18:17:18 +0100

Hi Tristan,

The query support is actually missing at the declarative hyper-linking
module.
I think we should add this feature.

Could you please file a RFE for this?

Thanks,

~Jakub


On 03/14/2011 03:37 PM, Tristan Wehrmaker wrote:
> Any ideas on this topic?
>
> Am 07.03.2011 11:53, schrieb Tristan Wehrmaker:
>> Hi,
>>
>> I'm wondering how to add query parameters to URIs generated with the
>> Ref annotation.
>> In my case I have a root-resource BooksResource with subresources
>> BookResource.
>> The URI templates are: /books and /books/{id}
>>
>> Now I want to add pagination to the books resource, so that I have a
>> query parameter for the page like this: /books?page=5
>>
>> My approach now was this:
>> @Ref(
>> value="books?page=${instance.page - 1}",
>> condition="${instance.page > 0}",
>> style=Style.ABSOLUTE
>> )
>> @XmlElement
>> URI previous;
>>
>> But then the ? gets replaced by %3F.
>>
>> So my question is, what is the best way to add query parameters to
>> such URIs?
>>
>> Best regards,
>> Tristan
>
>