简体   繁体   中英

How to route all path to a single ServerResource with Restlet

This code is a very basic Restlet app:

public class FirstStepsApplication extends Application {
  private static final String ROOT_URI = "/";
  @Override
  public Restlet createInboundRoot() {
    Router router = new Router(getContext());
    router.attach(ROOT_URI, RootServerResource.class);
    return router;
  }
}

How can I route not just root " / " into the RootServerResource but also all " /* " path? Is this a limitation of restlet or this can be done?

尝试:

  router.attachDefault(RootServerResource.class);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM