dev@glassfish.java.net

Re: REST API and slashes in resource names

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 01 Jun 2010 16:02:18 +0200

On Jun 1, 2010, at 3:41 PM, Ludovic Champenois wrote:
>>
>>
>>> So how about wrapping resource values that contain "reserved"
>>> characters by a pair of (unreserved) "normal" brackets '(' and ')'?
>>>
>>
>> It would work, but it is not clear to me if there is any need for
>> wrapping. Ludo?
>>
>> I think that would only be required if further path segments may
>> occur after e.g.
>>
>> .../management/domain/resources/admin-object-resource/(jndi/foo)/
>> bar/baz
> We currently have this pattern as GlassFish Resources may have sub-
> paths (for example, the properties of a resource:
> http://localhost:4848/management/domain/resources/jdbc-connection-pool/DerbyPool/property
> )
>
> I need to see what is the valid content for a resource name, but I
> guess we need wrapping there.

Yes. It is not so pretty but you can use something like the following
to match:

   @Path("({jndi: [^\\(\\)]+})")

Paul.