02.Subresource Locator - JohnyzHub/jax-rs GitHub Wiki

Sub-resource locator is a concept of plumbing a service(eg:ArtistInventory as a sub-resource to another service(eg:MoveDirectoryService). This feature supports dynamic dispatching(using factory pattern)

Inventory.java ArtistInventory.java TechnicianInventory.java

Note: The @Path annotation on the sub-resource(eg:ArtistInventory.java) is optional and application just ignores it while resolving url for sub-resource.

   POST: http://localhost:8080/moviedirectory/rest/directory/inventory/artist
          Headers:content-type - application/json
          parameters: name:kate winslet
                      movie:titanic
  
   GET: http://localhost:8080/moviedirectory/rest/directory/inventory/artist
          Headers:content-type - application/json
          parameters: name:kate winslet

   GET http://localhost:8080/moviedirectory/rest/directory/inventory/artist/all
     	content-type : application/json