Inject an UriInfo
instance in your resource method and use the getPathParameters()
or getPathSegments()
method:
@Path("category/{categoryIds:.+}/product/{productId}")
public ReturnType myMethod(@Context UriInfo uriInfo) {
for (PathSegment pathSegment: uriInfo.getPathSegments()) {
//do here what you want with the uriInfo
}
}