users@jersey.java.net

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

From: Tristan Wehrmaker <ml_at_3stan.net>
Date: Mon, 14 Mar 2011 15:37:21 +0100

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