I am working on RESTful web services using java. We all love REST-full-ness, so I'd like to return more REST-ful status codes from my endpoints. (Example: 201 CREATED along with JSON contents in response body. But I can't find any way to set the HTTP status code. Can anyone help please? I have seen many posts which says that currently custom status codes are not supported. Whether its still not supported or is there a way to do it rather than writing exception classes. Because if we write exception classes then we cant return JSON in response body.