RE: Wrong Resource baseRef when using WadlApplication
Hi Carsten, Thanks for reporting what looks like a defect. I've entered this issue: Base reference issues with WADL http://restlet.tigris.org/issues/show_bug.cgi?id=877 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Carsten Lohmann [mailto:c_lohm...@gmx.net] Envoyé : vendredi 31 juillet 2009 08:08 À : discuss@restlet.tigris.org Objet : RE: Wrong Resource baseRef when using WadlApplication Found a workaround: In WadlApplication.getApplicationInfo() there is: applicationInfo.getResources().setBaseRef(request.getResourceRef().getBaseRe f()); I override this getApplicationInfo and do applicationInfo.getResources().setBaseRef(request.getRootRef()); and then things work, ie. the URIs in the generated WADL are correct. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23772 55 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2384255
Wrong Resource baseRef when using WadlApplication
Hi, I have a problem concerning wrong resource paths in the WADL output of a WadlApplication. I have a WADL application to which I attach several restlets. When an OPTIONS request is received, it reaches the router of the WADL application. If there is a matching route to a restlet, the request resource baseRef gets adapted to the URI of the resource itself (in Route.beforeHandle()). Then in the target restlet handle() method I set the allowed methods and do a return. The further processing is done in WadlApplication.handle(). There, the request resource baseRef is still the restlet ressource URI and *not* the base URI of the WadlApplication. This results in wrong ressource URIs in the generated WADL. When I submit an OPTIONS request that reaches the WadlApplication, but which is not routed to any restlet after that (like http:[applicationBasePath]/nonExistingPath?method=OPTIONS), the generated WADL has the correct URIs. Any ideas how to fix this? I thought about adapting the request resource baseRef in the restlet handle() method (setting it back to the application baseRef), but that does not seem to be a clean solution. TIA, Carsten -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2376892
Wrong Resource baseRef when using WadlApplication
Hi, I have a problem concerning wrong resource paths in the WADL output of a WadlApplication. I have a WADL application to which I attach several restlets. When an OPTIONS request is received, it reaches the router of the WADL application. If there is a matching route to a restlet, the request resource baseRef gets adapted to the URI of the resource itself (in Route.beforeHandle()). Then in the target restlet handle() method I set the allowed methods and do a return. The further processing is done in WadlApplication.handle(). There, the request resource baseRef is still the restlet ressource URI and *not* the base URI of the WadlApplication. This results in wrong ressource URIs in the generated WADL. When I submit an OPTIONS request that reaches the WadlApplication, but which is not routed to any restlet after that (like http:[applicationBasePath]/nonExistingPath?method=OPTIONS), the generated WADL has the correct URIs. Any ideas how to fix this? I thought about adapting the request resource baseRef in the restlet handle() method (setting it back to the application baseRef), but that does not seem to be a clean solution. TIA, Carsten -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2376898