cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad <...@javawork.co.uk>
Subject returning HTTP errors using JAX-RS
Date Mon, 28 Apr 2008 15:06:35 GMT
Hi,

I've got a basic test application which I'm trying to get to return
HTTP error codes. In th eapplication I'm doing this:

throw new WebApplicationException(HttpURLConnection.HTTP_FORBIDDEN);

Which gives me this in my browser:

<ns1:XMLFault xmlns:ns1="http://cxf.apache.org/bindings/xformat">
    <ns1:faultstring
xmlns:ns1="http://cxf.apache.org/bindings/xformat">javax.ws.rs.WebApplicationException</ns1:faultstring>
</ns1:XMLFault>

I was expecting to see HTTP error 403. The resource class usess
application/xml for ProducesMime and ConsumesMime, is that what's
stopping me from seeing the HTTP error?

Thanks,
Brad.

Mime
View raw message