Map variable URI path fragments to method calls
Chapter 5. @PathParam 5.1. Advanced @PathParam and Regular Expressions 5.2. @PathParam and PathSegment @PathParam is a parameter annotation which allows you to map variable URI path fragments into your method call. @Path("/library") public class Library { @GET @Path("/book/{isbn}") public String getBook(@PathParam("isbn") String id) { // search my database and get a string representation and return it } } What this allows you to do is embed variable identification within the URIs of your resources. In the above example, an isbn URI parameter is used to pass information about the book we want to access. The parameter type you inject into can be any primitive type, a String, or any Java object that has a constructor that takes a String parameter, or a static valueOf method that takes a String as a parameter.