Alex,

[...]

> If I use URL pattern like these
> 
> router.attach("/dir", IAPRestFileResource.class);
> router.attach("/dir/{dir}", IAPRestFileResource.class);
> 
> I cannot get into the Resource, though I can clearly see, 
> from the log, that the
> URL has been assigned to request.resourceRef 
> "/MyFirstOc4j/dir/abc/afile/"):

This should definitely work.

> 1) Why cannot I specify the URL pattern?  How would I avoid 
> in reinventing the
> wheel to get those parameters from the link by parsing the URL from
> request.resourceRef by myself?

The probable reason for the routing failure it the wrong state of the
Request's "baseRef" property. Could you debug or log its value before the
routing?
 
> 2) even more serious, When there is escape character in the URL, e.g.,
> 
> http://localhost:8081/MyFirstOc4j/dir/c%3a%5ctemp/afile/
> 
> I cannot even get into Application.  Why and is there a 
> standard method to cater for escaped characters?

There is no 'transparent' or default URI decoding done by the Restlet
API/engine. However, the "/dir/{dir}" pattern should match those URIs as
well. Then you can use the Reference.decode() static method in your Resource
to get the decoded "dir" attribute's value.

Best regards,
Jerome  

Reply via email to