Hi Christian
JAX-RS UriBuilder will produce something like "/a;b" if one only
supplies a matrix param name, ex,
builder.path("a").matrixParam("b");
Higher level API such as JAX-RS WebTarget or CXF WebClient have
matrixParam methods which are mapped to UriBuilder.matrixParam.
So rather than deal with 'booleans' you can simply do
webClient.path("a").matrixParam("enabled")
("/a;enabled")
or
webClient.path("a").matrixParam("disabled")
("/a;disabled")
or not setting a matrix property at all,
as opposed to dealing with 'enabled' true/false values.
Or do you use a proxy where you have a method accepting 'boolean'
(matrix) parameter ?
Cheers, Sergey
On 25/10/16 17:45, Christian Balzer wrote:
Hi Sergey,
I agree this is a should, not a must - but I do like URLs to look pretty... ;-)
I have currently no requirement for this, though - I just wanted to
know if it can be done with cxf.
I take it the answer is "no", then? :-)
Brgrds,
Christian
On Tue, Oct 25, 2016 at 11:49 AM, Sergey Beryozkin <[email protected]> wrote:
Hi
I think it is an optimization as opposed to some 'must' rule governing the
way all the boolean matrix properties are represented.
I agree having something like "/somepath;enabled"
looks better than
"/somepath;enabled=true"
and
"/somepath;enabled=false"
is more verbose than
"/somepath"
but the more verbose options are perfectly valid URIs and note some services
may be written to assume the parameter is included - WADL also has a
'required' property which can be set to true.
I can only imagine this optimization be optionally implemented at the client
side if a property is set. Is it really important to you ?
Sergey
On 24/10/16 15:10, Christian Balzer wrote:
Hi all,
The Web Application Description Language specification [1] defines:
Boolean matrix parameters are represented as: ';name' when 'value' is
'true' and are omitted from identifier when 'value' is 'false'
Is there a way to achieve this behavior with cxf out of the box?
Brgrds,
Christian
1) https://www.w3.org/Submission/wadl/#x3-130002.6.1