users@jsr311.java.net

Re: JAX-RS: _at_Path regex syntax

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 01 Aug 2008 11:17:16 +0200

Marc Hadley wrote:
> On Jul 28, 2008, at 11:27 AM, Paul Sandoz wrote:
>>
>> The intention was to support your first preference in that "regex"
>> must have matching open and close braces.
>>
> Right. Since unescaped '{' and '}' and not valid in URI paths then I
> don't see that disallowing their unmatched use in the regex will cause
> any problems.
>
>>> Allowing spaces and tabs (WSP) in a placeholder seems a bit
>>> unnecessary. I guess it doesn’t do much harm, though I wouldn’t be
>>> surprised if some code used the regex “\s*” or String.trim() to
>>> implement *WSP, which is not quite correct.
>>
>> Good point.
>>
> I think I'm missing something. Why would use of String.trim() cause a
> problem ? Any literal WSP character in regex would have to be in encoded
> form otherwise it wouldn't match the corresponding encoded char in the
> URI...
>

You are correct, all characters < 0x20 would need to be percent encoded.

I am guessing that if you use String.trim it is harder to report any
possible errors with the regex for such literal characters at the start
or end, although i doubt those errors would be very probable.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109