dev@glassfish.java.net

Re: REST API and slashes in resource names

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Thu, 27 May 2010 14:52:48 -0500

Is this a case where URL encoding should be used, i.e., %2F instance of /.

Thus, the URL should be:
http://localhost:4848/management/domain/resources/admin-object-resource/jndi%2Ffoo


And the name has to be URL-decoded before it is used.
Tom


On 5/27/2010 2:40 PM, Jason Lee wrote:
> I've run into an issue with REST API. Take this URL:
> http://localhost:4848/management/domain/resources/admin-object-resource/jndi-foo
>
>
> The resource name is identified by the last...segment of the URI, in
> this case jndi-foo. The system then takes that name and passes it to
> the CLI. The problem is that the actual ID in the system is jndi/foo,
> not jndi-foo We have to, then, convert that - to a /, but we can't do
> it every time, as my-connection-pool is a valid name. We could use, I
> guess, a query string param :
>
>
> http://localhost:4848/management/domain/resources/admin-object-resource/jndi-foo?convertDash=true
>
>
> But jndi/my-connection is a valid resource name as well, and that
> resource would be identified by
>
>
> http://localhost:4848/management/domain/resources/admin-object-resource/jndi-my-connection
>
>
> Just replacing the first dash won't be sufficient either, as "foo/"
> (be it jdbc, jms, etc) is not required in the JNDI/resource name, so
> my-jms-destination is valid.
>
> Anyone have any great ideas on how best to convert the resource name
> in the URI to the actual resource name in domain.xml?
>

-- 
Oracle <http://www.oracle.com>
Tom Mueller | Principal Member of Technical Staff
Phone: +1 4029169943 | Fax: +1 4029169943 | Mobile: +1 4027206872
21915 Hillandale Dr | Elkhorn, NE 68022
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment