users@jsr311.java.net

Re: JSR311 Response and corresponding message

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 09 Sep 2008 12:08:02 +0200

On Sep 9, 2008, at 11:40 AM, Denis wrote:

> Hi all,
>
> Is it possible to use the HttpServletResponse class with Jersey?

Yes, and it should be the same for other JAX-RS implementations.


>
> I just noticed that the sendError(int sc,String msg) method can
> customize an error code.
> It means that it is possible to have a header like that:
> HTTP/1.1 404 My custom message
>

You are right. I just checked with a simple servlet implementation and
the "msg" parameter does indeed correspond to the reason phrase on the
status line.

Drat! that is an oversight on our part.

Paul.

>
> On Wed, Sep 3, 2008 at 7:06 PM, Marc Hadley <Marc.Hadley_at_sun.com>
> wrote:
> No, currently that is not possible. We did discuss this but since
> there's no way to set the status message for runtimes based on the
> Servlet container there seemed no point in adding it to the JSR 311
> API.
>
> Marc.
>
>
> On Sep 3, 2008, at 12:48 PM, Denis wrote:
>
> Hi all,
>
> Is it possible to specify a message with a Response status code?
> For instance, if I see the header of the response, I would like to
> see:
> 200 Good Response
> 400 Too bad
> ...
>
> Thanks for your help
>
> Denis
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>