dev@glassfish.java.net

Re: REST API and slashes in resource names

From: Bruno Harbulot <Bruno.Harbulot_at_manchester.ac.uk>
Date: Thu, 03 Jun 2010 18:18:09 +0100

Hi,

On 01/06/10 17:23, Paul Sandoz wrote:

>>>
>>> So how about wrapping resource values that contain "reserved" characters
>>> by a pair of (unreserved) "normal" brackets '(' and ')'?
>>
>> I'm not sure whether you want to take more recent RFCs into
>> consideration, but in RFC 3986, which obsoletes RFC 2389,
>
> Good point. I was using the URI spec that is referenced by HTTP 1.1
> (maybe the work on tidying up the HTTP spec will update the reference?)
>
>
>> parentheses are reserved characters:
>>
>> http://tools.ietf.org/html/rfc3986#section-2.2
>>
>> Section 2.4 is probably relevant to this discussion too (especially
>> its last sentence).
>>
>
> I am not sure what the last sentence actually means in terms of parsing
> a URI :-) but i strongly suspect for HTTP schemes and the path component
> that '(' and ')' are OK. Jersey does not encode such characters when URI
> building path components e.g.:

I don't know JAX-RS well enough (I must admit I tend to use Restlet,
without its JAX-RS extension), but I've just had a quick look at its
specifications. Both specifications (1.0 and 1.1) refer to RFC 3986 for
the URI syntax (section 3.7 for example).

It sounds like the fact Jersey uses '(' and ')' (non-encoded) could be a
bug there.


Best wishes,

Bruno.