Restlet以外のjspやサーブレット等も呼び出せるように
するには、Restletとして実行させるURLを別途用意した方がよい。
その設定はWeb.xmlに設定する
例) /rest から始まるURLのみのとする場合
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
こうしておけば、 http://localhost:8080/アプリケーション/index.jspも普通の動作する。
Applicationクラスのルーティングはその指定とは相対的にルーティングするので
合わせて修正する必要はなかった。
例)
@Override
public synchronized Restlet createInboundRoot(){
Router router = new Router(getContext());
router.attach("/hello",HelloWorldResource.class);
router.attach("/param",ParamResource.class);
router.attach("/paramExe",ParamExe.class);
router.attach("/paramExe2",ParamExe2.class);
return router;
}
/paramExe2 は http://localhost:8080/アプリケーション/rest/paramExe2
で呼び出される。