Matrix Params question and concern

From: Heiko Braun <>
Date: Sat, 15 Dec 2007 19:41:24 +0100

(Bill Burke:)

I was looking at the definition of Matrix parameters:

RFC 2396 again, sec. 3.3:

" The path may consist of a sequence of path segments separated by a
    single slash "/" character. Within a path segment, the characters
    "/", ";", "=", and "?" are reserved. Each path segment may include
    sequence of parameters, indicated by the semicolon ";" character.
    The parameters are not significant to the parsing of relative
    references. "

What I think this means is that you may have matrix parameters embedded
within any path segment of a URI. If this is true, then this has
implications on various contracts within JSR-311.

* URIBuilder assumes that Matrix parameters only happen once and at the
last path segment.

* matrix parameter names could be repeated throughout the URI and thus
@MatrixParam could be ambiguous.


On a different, but related note, I think it would be interesting to
allow injection of a object for a @UriParam

public String get(@UriParam("seg") PathSegment param) {...}

This way, for a specific segment, the app developer can pull out matrix
parameters specific to that path segment.

What's a usecase? Well, I'm prototyping something that gives access to
a specific database and some entities will have composite keys that I
want to map into a URI


Would be:

public JPEG get(@UriParam("db") String db,
                   @UriParam("entity-name") String entity,
                   @UriParam("key") PathSegment key,
                   @UriParam("property) String property) {...}