Posts

Showing posts with the label multiple-value

GET in JAX-RS with multiple parameters separated by &

Image
Clash Royale CLAN TAG #URR8PPP GET in JAX-RS with multiple parameters separated by & I am developing a JAX-RS backend and I would like to develop a service for GET requests like: http://completeDoc?id=23&id=24 where the number of id is variable. I would like some kind of @GET and @PathParam annotation to extract the List of id s id So far my code looks like this: @GET @Path("/completeDoc") @Produces("application/msword") public Response getCompleteDoc(@QueryParam("id") int id) { System.out.println(id); return Response.status(Response.Status.NOT_FOUND).build(); } Obviously as it is it reads only the first id. If you want multiple int values, use int . That seems fairly obvious, right? – Andreas 1 hour ago int int Or List<Integer> . – shmosel ...