Skip to Content
RESTful Java Web Services - Third Edition
book

RESTful Java Web Services - Third Edition

by Balachandar Bogunuva Mohanram
November 2017
Intermediate to advanced
420 pages
10h 29m
English
Packt Publishing
Content preview from RESTful Java Web Services - Third Edition

Request matching

JAX-RS uses the @Path annotation for dispatching requests to corresponding resource or sub-resource methods using the following steps:

  1. Identify a set of candidate root resource classes matching the request.
  2. Obtain a set of candidate resource methods for the request.
  1. Identify the method that will handle the request.
  2. If no matching resource method or sub-resource method can be found, then an appropriate error response is returned.

Now let us illustrate, for the following services, Service1 and Service2, how request dispatching happens when a client requests the target resources:

@Path("/s1")public class Service1 {    /**     * Creates a new instance of Service1         */    public Service1() {    }    @GET    @Path("{name : .+}") @Produces(MediaType.APPLICATION_JSON) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services, Second Edition

RESTful Java Web Services, Second Edition

Jobinesh Purushothaman
Java Web Services

Java Web Services

David A Chappell, Tyler Jewell

Publisher Resources

ISBN: 9781788294041Supplemental Content