users@jsr311.java.net

Re: Dealing with Matrix parameters

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

>>> 1. GET /base/beginTail;matrixParam=ParamValue
>>>
>>> The value for (@PathParam("tail") String) tail is "beginTail;
>>> matrixParam=ParamValue", but a user expectes only
>>> "beginTail".
>>He is right.
>
> ok - though it seems counterintuiitive to me. The docs for @Path state matrix parameters are not included - which to me says that
> @Path value should not have them - but not that they have to be excluded in the resulting value. But I'm ok with fixing it anyway.
>

here's another thing. A user sends this request :

GET /bar;dontignoreme=true;onlylowsugarplease=true/foo

yet

a method

@PATH("bar/foo")
public Bar getBar() {}

is happily invoked with a service code being totally unaware of any additional semantcs associated with 'bar'

My point is a service is written is either with matrix params in mind or not. If the service does not care about matrix params at
all then letting the requests containing matrix params be processed as if they contained none seems wrong.
So here's where PathSegment comes in - at least it's up to the user's code to decide if matrix params can be ignored or not

Cheers, Sergey