users@jersey.java.net

Using Response with non 200 responses

From: dloy <david.loy_at_ucop.edu>
Date: Mon, 14 Sep 2009 16:59:26 -0700

I currently use Response with the ok method.

Is it possible with Response to return a non-OK (e.g. 501) response with
a body and mime type for that response?
e.g. Response.ok(file, mimeType()).status(501).build(); I'm not sure if
http allows this.

Basically, I want to return an text/xml response containing information
about an exception with a bad status.

Also, could you tell me what is a good link for info on
javax.ws.rs.core.Response.Builder.

Thank you so much
David


*

*