Before winding up this chapter, let's take a quick look at the lifecycle of the JAX-RS components on the server when a client makes a RESTful web API call. This discussion would be a good summary of the topics that we learned so far on JAX-RS.
The following diagram depicts the sequence of actions taking place on the server when a client invokes the JAX-RS RESTful web service:
Here are the steps:
For an incoming REST API call, the container identifies the Java servlet configured for handling the REST API calls by parsing the URI and then delegates the request to the designated servlet.
The servlet initializes the JAX-RS runtime and kicks off the RESTful web service request processing cycle for the REST API call.
The JAX-RS runtime processes the filters and interceptors configured in the application in the following sequence:
Runtime executes prematching filters (
ContainerRequestFilter
with the@Prematching
annotation), which happens before resolving the...