JAX-RS provides means to generate response generically. The abstract class
javax.ws.js.core.Response is a contract object, which the developer uses to produce a generic response with metadata for the JAX-RS runtime provider. An application can extend this class directly or it can create an instance of Response object with the nested inner class
javax.ws.js.core.Response.ResponseBuilder. Most applications tend to use the
We have already seen an illustration of
ResponseBuilder in the custom
UnknownUserException exception class. Go back and revisit the user registry example in Defining JAX-RS Resources, if you need to study.
Response class has several static methods ...