If the paths have different subpaths, then you define the paths in separate @Path attributes in more detail, for example:
@Path("/users/{id:[a-z0-9]+}/sub1/")
@Path("/users/{id:[a-z0-9]+}/sub2/")
If you cannot indicate them to the extent that it is clear which resource to call is given in any particular way, Jersey will not be able to decide which resource to call.
source share