Hi,

One additional idea, maybe good, maybe bad: if your application really does
route all requests that have a certain base URI to the same resource, you
could also try just attaching the router to /ABC and use
request.getResourceRef().getRemainingPart() to obtain the rest of the URI
path not matched by the base URI, which you could then parse up according to
your app's specific needs.  You'll lose the auto-parsing of param1 and
param2, but you'll maintain complete control over the formatting of the
remaining URI part.

On Wed, Jan 28, 2009 at 9:14 AM, Rob Heittman <[email protected]>wrote:

> Free-associating here ... I expect that someone will write with a really
> cool way to construct the server-side patterns to meet your requirements!
>  But aesthetically, I'd probably like the API better if it escaped slashes
> if they occur internally in a single token.
> http://localhost/myApp/ABC/1900%2Ftree/leaf
>
> This "reads" straightforwardly to me outside of any Restlet specific
> implementation -- I know that you mean 1900%2Ftree to go together as one
> hierarchical token, and %__ immediately tells me that there's some
> uri-unescaping to do.
>
> This approach may not work for you -- it can lead down a slippery slope of
> whether and when to un-escape.  But it does read quite transparently for a
> REST (not necessarily Restlet) API specification.
>
> - R
>
> On Wed, Jan 28, 2009 at 3:32 AM, <[email protected]> wrote:
>
>> Hi,
>>
>>    How to pass a value(parameter) to the resource in a URI with / as a
>> part of the data. That means i have a resource registered like
>>
>> router.attach("/ABC/{param1}/{param2}",MyResource.java);
>>
>> the invocation URI given in browser is "
>> http://localhost/myApp/ABC/1900/tree/leaf";
>>
>> as per my requirement param1 should get "1900/tree" and param2 should get
>> "leaf". restlet is taking / as a separator which i want to avoid.
>>
>> help me to solve this ...
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1062236
>>
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1063227

Reply via email to