Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用Restlet将所有路径路由到单个ServerResource_Java_Restlet_Restlet 2.0 - Fatal编程技术网

Java 如何使用Restlet将所有路径路由到单个ServerResource

Java 如何使用Restlet将所有路径路由到单个ServerResource,java,restlet,restlet-2.0,Java,Restlet,Restlet 2.0,这段代码是一个非常基本的Restlet应用程序: public class FirstStepsApplication extends Application { private static final String ROOT_URI = "/"; @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); router.attach(ROOT_UR

这段代码是一个非常基本的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;
  }
}
我如何不仅将root“
/
”路由到
RootServerResource
,而且将所有“
/*
”路径?这是restlet的限制还是可以做到的

试试看:

  router.attachDefault(RootServerResource.class);