I\'ve been reading that the JAX-RS is built on top of servlets. Is this literally true, or it just mean that it is a higher level component? If it is, how does that work? Does J
I've been reading that the JAX-RS is built on top of servlets. Is this literally true,
Simply put, YES, the JAX-RS specification is built on top of Servlets, and any other deployment method (such as mentioned by @Jilles van Gurp) is implementation specific.
Does JAX-RS create a servlet which parses the request and manually initializes @Path annotated classes and passes the modified parameters to them?
JAX-RS doesn't do anything. It's the implementation (e.g. Jersey, RESTEasy, CXF) that implements the entry point servlet. Does the implementation need to explicitly parse the request? No, not all of it. Most of that stuff is handled by the servlet container. Mainly the implementation will just need to parse the request body (as "request" implies more than just the body, e.g URL, headers).
Basically, everything related to JAX-RS is handled by the implementation. The servlet container has nothing to with anything but passing the HttpServletRequest and HttpServletResponse, just like if you were to implement your own servlet. If you were to make your own JAX-RS implementation, the servlet passing you the HttpServletRequest(Response) is the request entry point, and everything else is up you.
as "request" implies more than just the body, e.g URL
Bad example. Actually, the JAX-RS implementation would parse the URL in order to get path parameters and query parameters. Though the Servlet container will parse the URL and add query parameters to the HttpServletRequest parameters map, that map also has form POST parameters, so the implementation will need to do it's own parsing of the query parameters also.