You can access one parameter through @QueryParam("name") or all parameters through a context:
@POST public Response postSomething(@QueryParam("name") String name, @Context UriInfo uriInfo, String content) { MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters(); String nameParam = queryParams.getFirst("name"); }
The key is the @Context jax-rs annotation , which you can use to access:
UriInfo, Request, HttpHeaders, SecurityContext, Providers
hisdrewness Apr 19 '11 at 3:30 p.m. 2011-04-19 15:30
source share