My Restlet application is now mapped in the web.xml to "/app" and "/app/*". I 
have a whole bunch of routes setup underneath this base URL in a function 
called setupApp(router).

Now, I plan to refactor things a bit and I want to change my web.xml so *every* 
call is intercepted by Restlet so "/*".

The existing routings like "/app/user/{userId}" must keep on working.

**Now I can manually add the first segment "app" to my existing routings so 
they keep on working. **

But there must be an easier way to do this. I expect something like this to 
work :

public synchronized Restlet createInboundRoot() {

  Router router = new Router(this.getContext());

  Router subRouter = new Router(this.getContext());
  router.add("/app/*", subRouter);
  // add new stuff to the router
  router.add("index.html", IndexRouter.class);


// existing code but now with first segment /app added ?
// in the original code, the main router is passed in
public void setupApp(Router subRouter) {

  subRouter.add("/user/{userId}", UserResource.class);
  subRouter.add("/user/{userId}", UserResource.class);


thx for the pointers ...



Reply via email to