How-to articles, tricks, and solutions about HTTP-STATUS-CODES
JAX-RS — How to return JSON and HTTP status code together?
In JAX-RS, you can use the Response class from the javax.ws.rs.core package to return a JSON response and an HTTP status code together. Here's an example of how to do this: