users@jsr311.java.net

Re: Dealing with Matrix parameters

From: Sergey Beryozkin <sergey.beryozkin_at_progress.com>
Date: Mon, 24 Nov 2008 16:07:52 -0000

Hi
>>
> All path segments are checked and the first value (lexically) of the parameter is used.
>

I fail to understand how this algorithm can be ever used in practical cases.
Clearly this algorithm is aware of the fact that identically named matrix parameters can be scattered across
multiple segments.

So given

@PATH({a}/{b}/{c})
someMethod(@MatrixParam("bar") String bar)

the bar value can be extracted either from /a or /b or /c path segments thus giving no indication to a user what path segment it was
associated with. Checking only the last path segment in case of @MatrixParam would make more sense IMHO, same for Lists of matrix
params. There're a reason users chose to associate matric parameteres with specifc path segments, it's not an arbitrary allocation,
as opposed to query parameters. Using @PathSegments per every path segment is the only reliable way to find out which segment a
given matrix parameter belongs to

Cheers, Sergey