users@jersey.java.net

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

From: Tristan Wehrmaker <ml_at_3stan.net>
Date: Mon, 07 Mar 2011 11:53:06 +0100

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