Example #1
0
  void doDispatch(Properties reqHash, String strIndex) throws IOException {
    reqHash.setProperty("request-method", this.method);
    reqHash.setProperty("request-uri", uri.getPath());
    reqHash.setProperty("request-query", uri.getQueryString());

    if (postData != null && postData.size() > 0) {
      if (!RHOCONF().getBool("log_skip_post")) LOG.TRACE(postData.toString());
      reqHash.setProperty("request-body", postData.toString());
    }

    RubyValue res = RhoRuby.processRequest(reqHash, reqHeaders, resHeaders, strIndex);
    processResponse(res);

    RhodesApp.getInstance().keepLastVisitedUrl(url_external);
    LOG.INFO("dispatch end");
  }
Example #2
0
  protected boolean dispatch() throws IOException {
    UrlParser up = new UrlParser(uri.getPath());
    String apps = up.next();
    String application;
    if (apps.equalsIgnoreCase("apps")) application = up.next();
    else application = apps;

    String model = up.next();

    if (model.length() == 0) return false;

    if (checkRhoExtensions(application, model)) return true;

    Properties reqHash = new Properties();

    String actionid = up.next();
    String actionnext = up.next();
    if (actionid.length() > 0) {
      if (actionid.length() > 2
          && actionid.charAt(0) == '{'
          && actionid.charAt(actionid.length() - 1) == '}') {
        reqHash.setProperty("id", actionid);
        reqHash.setProperty("action", actionnext);
      } else {
        reqHash.setProperty("id", actionnext);
        reqHash.setProperty("action", actionid);
      }
    }
    reqHash.setProperty("application", application);
    reqHash.setProperty("model", model);

    reqHash.setProperty("request-method", this.method);
    reqHash.setProperty("request-uri", uri.getPath());
    reqHash.setProperty("request-query", uri.getQueryString());

    if (postData != null && postData.size() > 0) {
      log(postData.toString());
      reqHash.setProperty("request-body", postData.toString());
    }

    RubyValue res = RhoRuby.processRequest(reqHash, reqHeaders, resHeaders);
    processResponse(res);

    return true;
  }