November 2017
Intermediate to advanced
420 pages
10h 29m
English
A URI path template, in general, has a URI part pointing to the resource. It can also take the path variables embedded in the syntax; this facility is used by the clients to pass parameters to the REST APIs, as appropriate. The @javax.ws.rs.PathParam annotation injects (or binds) the value of the matching path parameter present in the URI path template into a class field, a resource class bean property (the getter method for accessing the attribute), or a method parameter. Typically, this annotation is used in conjunction with the HTTP method type annotations, such as @GET, @POST, @PUT, and @DELETE.
The following example illustrates the use of the @PathParam annotation to read the value of the path parameter, id, into the deptId ...