Path segment sequence to vararg array in JAX-RS / Jersey?
问题 JAX-RS/Jersey allows URL path elements to be converted to Java method arguments using @PathParam annotations. Is there a way to convert an unknown number of path elements into arguments to a vararg Java method? I. e. /foo/bar/x/y/z should go to method: foo(@PathParam(...) String [] params) { ... } where params[0] is x , params[1] is y and params[2] is z Can I do this in Jersey/JAX-RS or some convenient way? 回答1: Not sure if this is exactly what you were looking for but you could do something