I'm not a Jersey guru but I read that Jersey cannot resolve Java methods based on query params, but it looks sometimes it does, here is my example.
This is the server code:
@GET
@Path("/services")
public String getAll(
@QueryParam("limit") Integer limit,
@QueryParam("offset") Integer offset){
return "1 2 3";
}
And this is the client code:
ClientResponse response = webResource
.path("services")
.queryParam("limit", "ab")
.get(ClientResponse.class);
logger.info(response.toString());
assertEquals(response.getStatus(), 200);
It looks like Jersey doesn't like "ab" and isn't able to map the query param so it returns 404, however if limit = "1", i can hit the right method.
Is Jersey right to return 404 in this case? I know i could broaden the interface using String rather than Integer to override all the treatment for any feasible syntax error. Can I configure Jersey to do this on my behalf?
I'm using server: Grizzly/1.9.18, with Jersey 1.11