【问题标题】:How to route all path to a single ServerResource with Restlet如何使用 Restlet 将所有路径路由到单个 ServerResource
【发布时间】:2014-08-26 14:31:54
【问题描述】:

这段代码是一个非常基本的 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的限制还是可以做到?

【问题讨论】:

    标签: java restlet restlet-2.0


    【解决方案1】:

    试试:

      router.attachDefault(RootServerResource.class);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多