dev@jsr311.java.net

RE: Issue 1: Adding additional conneg metadata to _at_Produce/ConsumeXXX

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Sat, 23 Jun 2007 11:06:01 +0200

Hi Paul,

> Agreed, we can do that now with Produce*. But, the cases i am
> trying to
> highlight are when what is acceptable cannot be determined statically:
>
> 1) a method is declared to produce more than one acceptable
> thing, for
> example "image/*" but only certain image formats are supported, the
> number of which grows over time; and

In this case, we need a @MediaType annotation on the representation class
itself, indicating the method that exposes the media type dynamically.

> 2) if we choose not to do non-declarative negotiation on certain
> acceptable information, such as language (i suspect that for language
> the common case is to grow the number of supported languages
> over time
> without changing existing networking every time a new
> language is added).

The same @Language annotation approach could works equally well for dynamic
scenarios.

Best regards,
Jerome