Besides the @IanRoberts suggestion, you can use the annotation @Encodedto go to the original unspecified value of your parameter (by default, Jersey decodes the values and therefore id+ASCbecomes id ASCin your code).
The following example retrieves the decoded value as for the default behavior:
@GET
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response test(@QueryParam("sort") String sort) {
// sort is "id ASC"
return Response.ok().entity(sort).build();
}
, @Encoded:
@GET
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response test(@QueryParam("sort") @Encoded String sort) {
// sort is "id+ASC"
return Response.ok().entity(sort).build();
}