users@jersey.java.net

Re: [Jersey] Setting the HTTP Reason Phrase in a Jersey response

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 13 Oct 2009 10:48:10 +0200

Hi Mark,

It is currently not supported. Although there is some support in
Response.StatusType this gets narrowed down to the status code value
only when set. (although an implementation could provide a mapping
somewhere else).

Also, part of the problem is that Servlet provides only limited
support for setting the reason phrase (only for errors with no
response entity). Thus AFAIK it is actually not possible for Jersey to
implement this consistently when using the Servlet API.

Paul.


On Oct 12, 2009, at 4:59 AM, Mark Petrovic wrote:

> Good day.
>
> I see no method on the Response.Builder to set the HTTP reason
> phrase, e.g, the "Invalid Thingy" in
>
> HTTP/1.1 400 Invalid Thingy
> X-Powered-By: Servlet/2.5
> Server: Sun GlassFish Enterprise Server v2.1 Patch01
> ...
>
> Have I overlooked a Jersey API for setting the reason phrase?
>
> Thanks.
>
> --
> Mark Petrovic
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>