コード例 #1
0
ファイル: EnergyAtHome.java プロジェクト: elifesy/jemma
  protected synchronized void setHttpService(HttpService s) {
    ahHttpAdapter = new HttpAhBinder();

    this.setRootUrl(applicationWebAlias);

    Servlet customJsonServlet = new CustomJsonServlet(ahHttpAdapter, "");
    Servlet jsonRPC = new JsonRPC(ahHttpAdapter, "");

    this.registerResource("/", "webapp/ehdemo");
    this.registerResource("/gh", "webapp/gh");
    this.registerResource("/post-json", customJsonServlet);
    this.registerResource("/json-rpc", jsonRPC);
    this.registerResource(
        "/JSON-RPC",
        new JSONRPCServlet() {
          public void init(ServletConfig config) throws ServletException {
            super.init(new ServletConfigDisableGZIPWrapper(config));
          }
        });

    this.setHttpContext(this);

    this.update(null);
    super.bindHttpService(s);
  }