I'm trying to make a Restful interface that at the top level has a 'container' for a collection of existing Restlets. These contained restlets expect the path they are given to start with a slash, as is the convention.
However, I can't get the root-level container router to behave the way I need. If I add the contained restlets to the router like this: router.attach("/"+name, new ChildRestlet(name), Template.MODE_EQUALS); it will not work correctly, in that it doesn't route to the child when any of its sub-resources are asked for. If I add the contained restlets to the router like this: router.attach("/"+name, new ChildRestlet(name), Template.MODE_STARTS_WITH); it will not work correctly, in that if I have a child named 'foo', it swallows requests for '/foobar', even if there is a child named 'foobar'. If I add the contained restlets to the router like this: router.attach("/"+name+"/", new ChildRestlet(name), Template.MODE_STARTS_WITH); it will not work correctly, in that the 'remaining part' given to the child restlet is missing its leading slash. Is there some way to have matching that compares up to the first '/' without eating it? Or a path template that does lookahead for a slash without capturing it? If there's no out of the box way to accomplish this, I assume I have to subclass the Router to get this to work? -John ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2714205