dev@jsr311.java.net

Re: ProduceMime and ConsumeMime

From: Julian Reschke <julian.reschke_at_gmx.de>
Date: Mon, 09 Apr 2007 19:41:21 +0200

Marc Hadley schrieb:
> On Apr 9, 2007, at 11:46 AM, Julian Reschke wrote:
>
>> Marc Hadley schrieb:
>>> Right. The thinking is that if you have a lot of methods with common
>>> media type characteristics you can put the annotations at the class
>>> level and then only override them for individual methods that differ.
>>> If you only have a couple of methods in total and they are different
>>> you can just put the annotations at the method level since class
>>> level annotations won't save anything.
>>
>> OK, thanks for the clarification.
>>
>> Do you have a real-world use case in mind where a resource would
>> actually accept many methods with the same types of payloads? Right
>> now, I can't think of any...
>>
> You might want a bunch of POST methods that all return different media
> types. That way you can leave the content negotiation to the JSR 311
> runtime which will call the correct method based on the value of the
> Accept header in the request, e.g.:
> ...

I see.

Seems I mixed up "method" (as in Java) with "method" (as in HTTP).

Best regards, Julian