此代码是一个非常基本的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的限制还是可以做到的?
答案 0 :(得分:1)
尝试:
router.attachDefault(RootServerResource.class);