Open glassfishrobot opened 11 years ago
@glassfishrobot Commented Reported by dkonecny
@glassfishrobot Commented geertjan said: I agree, this would be very useful, because JAX-RS 2.0 should ideally be at least as good (preferably better) than Jersey.
@glassfishrobot Commented philipcrow said: Agree. Would be an appreciated improvement to have WebTarget.queryParams(MultivaluedMap).
Has been mentioned on StackOverflow with other users wanting that function here: http://stackoverflow.com/q/29409950/977087
Jersey current version is at 2.22.2
@glassfishrobot Commented This issue was imported from java.net JIRA JAX_RS_SPEC-403
What's the status of this? How hard can it be to add a single method?
Feel free to provide a pull request for this. :-)
But please note that such a change may also require changes to the spec document, the TCK and maybe even more.
Why did it have to be removed in the first place? It exists in 1.9, and 2.x still supports MultivaluedMap
.
I don't know about the details. But it wasn't actually "removed". It just wasn't part of the new JAX-RS API which was defined back then and which was heavily inspired by the Jersey implementation.
Prior to JAX-RS 2.0 the Jersey had a method which accepted MultivaluedMap which allowed to write most of the code in single line, eg:
return target.queryParam("api_sig", signature). queryParams(getQueryOrFormParams(queryParamNames, queryParamValues)). // getQueryOrFormParams returns MultivaluedMap queryParams(getQParams(optionalQueryParams)). // getQParams returns MultivaluedMap accept(javax.ws.rs.core.MediaType.TEXT_XML). get(responseType);
In JAX-RS 2.0 above code needs to be rewritten using iteration over array and calling WebTarget.queryParam(key, values)
Environment
any
Affected Versions
[2.0]