users@jersey.java.net

Re: [Jersey] How to set return code?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 27 May 2008 14:28:27 -0400

You need to return an instance of javax.ws.rs.core.Response from your
resource method, see

https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/Response.html

It uses a builder pattern to make this easy, e.g.:

return Response.status(...).type(...).entity(...).build();

Marc.

On May 27, 2008, at 2:05 PM, Markus KARG wrote:

> I have written an OPTION and PROPFIND annotation, and they seem to
> work well. But there is one question left open. The caller always
> gets a return code of 200. How do I tell my Resource that it shall
> return a code of 207 instead?
>
> Thanks
> Markus
>
> --
> http://www.xing.com/go/invita/58469
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.