Re: JSR311: Header and Response Code constants

From: Stephan Koops <>
Date: Wed, 19 Mar 2008 14:24:34 +0100

Hi Marc,

I also think, that it is easier to use if we also have Response r =
A lot of people will build Utility methods for something like that, if
it is not available. I think, we should leave it in.

>> Give that we'll have
>> Response r = Response.status(Status.NO_CONTENT).build();
>> it seems redundant to also have
>> Response r = Response.noContent().build();
> I rather like the conciseness of the latter, plus i think for common
> stuff it reads better and links more easily to the JavaDoc for
> specified behaviour. I found such methods convenient when we added
> them as opposed to using status (using a constant type or otherwise).
> It is also more consistent if things are change:
> Response.ok(entity).build();
> Response.ok().entity(entity).build();
> (something that i learned was important to maintain when using the
> builder model with the Jersey client API).
> Paul.
>> Unless anyone wants to object I intend to remove the no-arg static
>> methods of Response (ok, noContent, serverError, notModified) when I
>> add the Status constants ?
>> I'll leave the variants with arguments since they nicely group
>> together a set of interrelated metadata.
>> Marc.