users@jsr311.java.net

Re: ResponseBuilder.type()

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Fri, 20 Jun 2008 13:32:13 +0200

Hi Paul,
>> IMO it should not be an error, because "HTTP/1.1 servers are allowed
>> to return responses which are not acceptable according to the accept
>> headers sent in the request." (from
>> http://tools.ietf.org/html/rfc2616#section-10.4.7)
>> I think: If the Response method sets a media type, the one of
>> @ProduceMime must be ignored. An example for other media types could
>> be, if the method want to send details for an error (or redirection
>> with options) status.
> Perhaps it should be based on the status code? If the status code is <
> 300 then it should be an error otherwise not?
Something like that is good. For 2xx we could forbid it.
What should happen for status 1xx? The RFC
(http://tools.ietf.org/html/rfc2616#section-10.1) says, that they
include only the status line and perhaps headers. But I think here we
should have no restrictions.
> I think it is important that @ProduceMime has value as a declaration
> for those who are looking at the code and for generating documentation
> or machine processable descriptions: namely under certain conditions
> the media types declared in @ProduceMime are the only media types that
> may be returned.
You mean e.g. WADL generating tools?

best regards
   Stephan