Description
Consider the following scenario:
I have a resource with 2 methods:
@HttpMethod("GET")
@UriTemplate("/users/
@ProduceMime("text/xml")
public Response getUser(@UriParam("id") String id) throws Exception { ....}
@HttpMethod("GET")
@UriTemplate("/users/{id}
")
@ProduceMime("application/json")
public Response getUserJSON(@UriParam("id") String id) throws Exception
If I then send a request to /users/24 with Accept headers of "text/xml, /" one would expect the "text/xml" method to be invoked. However in the CXF implementation the application/json one is invoked. Suggest changing the algorithm to:
1. Sort the Accept header according to the W3 standards
2. Iterate through the accept header list. For each one:
1. Find all matching methods
2. If there is only one method return this and break out of the accept header loop
3. If there are multiple methods sort these methods using consume mime and produce mime. Then return the first
Attachments
Issue Links
- is part of
-
CXF-1415 Upgrade the version of jsr311-api.jar to 0.5
- Closed