users@jsr311.java.net

Re: Decoding '+' in path parameters

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Tue, 10 Mar 2009 19:19:26 +0100

Hi Sergey,

the '+' must definitely be converted to a space. E.g. every browser
encodes a space to '+', if you submit a form with GET

best regards
   Stephan
> Hi,
>
> PathParam values are automatically decoded by JAXRS implementations
> unless @Encoded is specified.
> In CXF we just use URLDecoder to decode. If '+' is contained in a
> given value then URLDecoder will produce an empty space instead of
> '+' and one of the CXF users sees it as a bug.
> I reckon that if a user percent-encoded a '+' or added @Encoded
> annotation to a path parameter, then things would work fine.
>
> What I'm kind of confused about is that '+' is listed at [1] as one of
> the reserved characters, and the test says that it is percent-encoded
> values that have to be decoded.
>
> Is CXF JAXRS-compliant (I'm asking it this way to make this post less
> off-topic :-)) in the way it decodes '+' (to space by default) ?
>
> Thanks, Sergey
>
> [1] http://tools.ietf.org/html/rfc3986