users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: best match for wildcard?

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Mon, 20 May 2013 10:01:20 +0100

On 20/05/13 09:55, Sergey Beryozkin wrote:
> On 19/05/13 23:36, Bill Burke wrote:
>> If the Content-Type header is null, then the implicit media type of the
>> request is "*/*", correct? Given that, which method would match?
>>
>> @POST
>> @Path("start")
>> public Response start();
>>
>> @POST
>> @Consumes(MediaType.APPLICATION_XML)
>> @Path("start")
>> public Response start(Action action);
>>
>>
>> What is the "best match" for a Content-Type of "*/*"? Another "*/*"
>> takes precedence in this case because it is an exact match?
> start(Action action)

Actually, in this case, it has to be start() - application/octet-stream
is a default value when CT is null

Sergey

>
> A number of TCK tests assume an exact match for some reasons (not
> supported anywhere in the spec), say two providers typed on "*/*" and
> "text/plain" and a "*/*" provider is selected, etc.
>
> Sergey


-- 
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com