dev@jsr311.java.net

Re: Redirection and creation <was> Re: Container Independence

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 16 Apr 2007 10:54:17 -0400

On Apr 15, 2007, at 1:31 PM, Jerome Louvel wrote:
>
>> For (ii) we already have @HeaderParam though there has been
>> discussion about additional annotations for specific headers,
>> e.g. an @Accept annotation could be used instead of
> getAcceptableMediaTypes.
>> I think I'm OK with this to a limited extent but I don't think we
>> should have a separate annotation for every request HTTP
>> header, that seems like overkill.
>
> I don't think that @Accept corresponds to the "Accept" HTTP header
> here. The
> "Accept" header list the media types accepted by the client, when the
> @Accept annotation lists those acceptable by the server.
>
It might not be what you had in mind, but the
HttpRequestContext.getAcceptableMediaType method does correspond to
the HTTP Accept header - i.e. it returns a list of media types that
the client will accept.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.