On Jan 19, 2010, at 3:24 PM, Jason Ragsdale wrote:
> All,
> I am looking to be able to have a specific jersey instance receive
> an set number of params as well as a unknown number of parameters
> after that. So for instance i may have matrix params a,b,c,d,e but i
> also need to accept _j,_x_z without knowing which of these if any
> are coming. Is there a way for me to do this?
You can inject UriInfo and obtain the map of matrix parameters for a
path segment:
https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/UriInfo.html
#getPathSegments%28%29
https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/PathSegment.html
#getMatrixParameters%28%29
Note that @MatrixParam only extracts the matrix parameters from the
last path segment of the URI path.
It is also possible to get a PathSegment for a path parameter:
@Path("{id}")
public ...(@PathParam("id") PathSegment ps) {}
Paul.