使用以下资源类
@Path("/cities")
public class CitiesResource {
public Response read(
@PathParam("???") final PathSegment path) {
// ...
}
}
如何为根PathSegment
获取@Path("/cities")
?
答案 0 :(得分:1)
PathSegment
@GET
public String read(@Context UriInfo info) {
List<PathSegment> segments = info.getPathSegments();
}