You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christian Balzer <ch...@gmail.com> on 2016/10/07 12:58:15 UTC

How to implement resource-specific matrix parameters

Hi all,

From what I know, matrix parameters are supposed to be
resource-specific - i.e. I should be able to do things like
/resource;a=foo/nestedResource;b=bar

I should even be able to do
/resource;a=foo/nestedResource;a=bar
i.e. use the same matrix param name "a", without "bar" overriding
"foo", because "foo" only relates to resource and "bar" only to
nestedResource

Now, how would the implementation for that look like in cxf?
How  can you deal with a request like that, that basically has
"namespaces" for each resource's parameters?

Is there a page on the docs that explains it that I missed?

Brgrds,
Christian

Re: How to implement resource-specific matrix parameters

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

You can either capture all 'a' with List<String> or use
JAX-RS PathSegment to capture path segment specific matrix parameters:

https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/PathSegment.html

HTH, Sergey
On 07/10/16 13:58, Christian Balzer wrote:
> Hi all,
>
> From what I know, matrix parameters are supposed to be
> resource-specific - i.e. I should be able to do things like
> /resource;a=foo/nestedResource;b=bar
>
> I should even be able to do
> /resource;a=foo/nestedResource;a=bar
> i.e. use the same matrix param name "a", without "bar" overriding
> "foo", because "foo" only relates to resource and "bar" only to
> nestedResource
>
> Now, how would the implementation for that look like in cxf?
> How  can you deal with a request like that, that basically has
> "namespaces" for each resource's parameters?
>
> Is there a page on the docs that explains it that I missed?
>
> Brgrds,
> Christian
>