In the rest service, the resource class is the core class that receives the rest request and completes the response, and the resource class is dispatched by the "provider" of the rest service, which is similar to the custom servlet class, which assigns the award request to the specified Controller/action class for processing,
The rest service is divided into 4 types according to the definition of the JAX-RS2.0 specification for rest service scenarios, such as
Type 1: When there is no application subclass in the service, the container looks for the servlet's subclass as a portal and if the servlet's subclass does not exist, then the rest service type is type 1
Type 2: When there are no application subclasses in the service, but there are subclasses of the servlet, the rest service type is type 2
Type 3: The subclass of application is defined in the service, and the application subclass uses @applicationpath annotations, then the rest service type is type 3
Type 4: If a subclass of application is defined in the service and the subclass of this application does not use @applicationpath annotations, then the rest service type is type 4
Jersey Rest Service Type