簡體   English   中英

如何使用Restlet將所有路徑路由到單個ServerResource

[英]How to route all path to a single ServerResource with Restlet

這段代碼是一個非常基本的Restlet應用程序:

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;
  }
}

我如何不僅將根“ / ”路由到RootServerResource ,還將所有“ /* ”路徑路由? 這是Restlet的限制還是可以做到的?

嘗試:

  router.attachDefault(RootServerResource.class);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM