I read that JAX-RS is built on top of servlets. This is literally true
Simply put, YES, the JAX-RS specification is built on top of Servlets, and any other deployment method (such as the one mentioned by @Jilles van Gurp ) is a specific implementation.
Does JAX-RS create a servlet that parses the request and manually initializes the annotated @Path classes and passes the changed parameters to them?
JAX-RS does nothing. This is an implementation (e.g. Jersey, RESTEasy, CXF) that implements the entry-point servlet. Is an implementation necessary for explicit query analysis? No, not all. Most of this material is handled by a servlet container. Basically, for the implementation, you just need to analyze the body of the request (since "request" means more than just the body, such as URLs, headers).
Basically, everything related to JAX-RS is handled by the implementation. The servlet container has nothing to do with passing the HttpServletRequest and HttpServletResponse, as if you were executing your own servlet. If you were to run your own JAX-RS implementation, the servlet passing you the HttpServletRequest (Response) is the request entry point, and everything else is up to you.
EDIT
as "request" means not only the body, for example URL
Bad example. In fact, the JAX-RS implementation will parse the URL to get path parameters and query parameters. Although the Servlet container will analyze the URL and add request parameters to the HttpServletRequest parameter map, this map also has the form of POST parameters, so for implementation you will also need to perform your own analysis of the request parameters.
source share