users@jersey.java.net

Re: Tomcat: response contains markup although not set by resource

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 17 Mar 2008 15:37:47 +0100

Martin Grotzke wrote:
> Hi,
>
> I have a resource that returns this response:
>
> Response.status( 409 ).build()
>
> The method that returns this response is simply annotated with @POST and
> the @Path, but not with any @ProduceMime.
>
> The response that the client receives has the correct status, but the
> body contains the markup of the 409 error page of tomcat, with
> Content-Type "text/html".
>
> With jetty this works as expected: the response does not contain a body.
>
> Would you say this is an issue of tomcat or of jersey?
>

It is a tomcat (and GF thing). They have common error pages when no
representation in the response is given. I suspect there is a property
to turn this off, but i don't know how to do it.

As a really dirty hack you could do:

   Response.status( 409 ).entity(" ").build()

but best to configure the web application properly.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109