In our previous example, we have been working with a RESTful web service to manage a single customer object. In real life, this would obviously not be very helpful. A common case is to develop a RESTful web service to handle a collection of objects (in our example, customers). To determine what specific object in the collection we are working with, we can pass parameters to our RESTful web services. There are two types of parameters we can use: query and path parameters.
We can add parameters to methods that will handle HTTP requests in our web service. Parameters decorated with the
@QueryParam annotation will be retrieved from the request URL.
The following example illustrates how to use query parameters ...