Chapter 5. @QueryParam
The @QueryParam annotation allows you to map a URI query string parameter or URL form-encoded parameter onto your method invocation.
GET /books?num=5
@GET public String getBooks(@QueryParam("num") int num) { ... }
Since RESTEasy is built on a Servlet, it cannot distinguish between URL query strings and URL form-encoded parameters. As with
@PathParam
, the type of parameter can be a primitive, a String, or a class with a String constructor or static valueOf()
method.