My Controller in jaxrs look like this
@GET
@Path("/search/{index}/{type}")
@Produces(MediaType.APPLICATION_JSON)
public MapBiodivResponse list(
@PathParam("index") String index, @PathParam("type") String type,
@QueryParam("trait_8") String trait_8, @QueryParam("trait_9") String trait_9,
@QueryParam("trait_10") String trait_10, @QueryParam("trait_11") String trait_11,
@QueryParam("trait_12") String trait_12, @QueryParam("trait_13") String trait_13,
@QueryParam("trait_15") String trait_15,
@QueryParam("bottom") Double bottom,
){
}
I wonder is that possible to collect all queryParams in jaxrs which have substring as trait and put that in Map. Something like this
@GET
@Path("/search/{index}/{type}")
@Produces(MediaType.APPLICATION_JSON)
public MapBiodivResponse list(
@PathParam("index") String index, @PathParam("type") String type,
@QueryParam("trait.*") String trait_8, @QueryParam("trait.*") Map trait,
@QueryParam("bottom") Double bottom,
){
}
I know the way to get all the parameter using @Context, but i just want to collect few queryParams on the basis of basis of either regex or some wildcard character.