Hi,

I've moved a Restlet.Application and a Restlet.Resource to tomcat. I run into
the following problems.


in servlet-mapping of web.xml, if I use "/*" or "/dir/*" , like below:

<servlet-mapping>
        <servlet-name>ServerServlet</servlet-name>
        <url-pattern>/*</url-pattern> or <url-pattern>/dir/*</url-pattern>
</servlet-mapping>

I can get into the Resource by entering URLs like these:

http://localhost:8081/MyFirstOc4j/dir/abc/afile/
http://localhost:8081/MyFirstOc4j/dir/something

where, however, in the Router.attach() statement, I can only specify an emtpy
String:

router.attach("", IAPRestFileResource.class);


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/"):

Aug 17, 2007 7:46:03 PM com.noelios.restlet.LogFilter afterHandle
INFO: 2007-08-17        19:46:03        127.0.0.1       -       127.0.0.1       
8081    GET
/MyFirstOc4j/dir/abc/afile/     -       404     331     -       1142413 
http://localhost:8081
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; OOCL; SV1; .NET CLR 1.1.4322;
InfoPath.1; .NET CLR 2.0.50727) -


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?


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?


Yours,
Alex

Reply via email to