Understanding the JAX-RS resource lifecycle

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:

Understanding the JAX-RS resource lifecycle

Here are the steps:

  1. 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.
  2. The servlet initializes ...

Get RESTful Java Web Services - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.