IN JAX-RS I need to iterate the (arbitrary) given query parameters in a request... but in their original order in the URI!
If I inject @Context UriInfo uriInfo
then I can use uriInfo.getQueryParameters()
to get a MultivaluedMap
of the query parameters, grouped by the query parameter name. But what if I care about the original order of all the query parameters? Is there a way to simply iterate the name/value pairs? Or must I extract them manually from uriInfo.getRequestUri()
?
If I'm stuck with manual extraction, is there some standard or well-maintained and updated library I can use for doing this?