November 2017
Intermediate to advanced
420 pages
10h 29m
English
Having discussed subresources, we will now see a subresource locator.
It is perfectly legal to use the @Path annotations on methods in a REST resource class without any resource method designators such as @GET, @POST, @PUT, or @DELETE. The objects returned by these methods will be used for resolving the incoming HTTP request further. These methods are called the subresource locators. These locators are useful when requests need to be further resolved dynamically by other objects. This gives you more flexibility in implementation.
In the following example, DepartmentResource is the root resource and the findManagerForDepartment() method is a subresource locator method. The findManagerForDepartment() method has ...