Skip to main content

Responses from Resource Methods

The resource method may return a custom Java class, JAX-RS Response or void. JAX-RS MessageBodyWriter providers are responsible for writing the custom Java class instance to the output stream. The runtime will set the HTTP 200 status.

Returning JAX-RS Response is useful when no response message is available, the HTTP status code needs to be customized or some response HTTP headers set. Returning "void" will result in the HTTP 204 (No Content) status beiing returned to the client.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!