コード例 #1
0
  public void processRequest() throws IOException {
    if (!requestProcessed) {
      String strErr = "";

      LOG.TRACE("processRequest: " + getURL());
      String strReferer = reqHeaders != null ? reqHeaders.getPropertyIgnoreCase("Referer") : "";
      if (getRef() != null
          && getRef().length() > 0
          && strReferer != null
          && strReferer.equalsIgnoreCase(uri_orig.getPathNoFragment())) {
        respondNotModified();
      } else {
        String strContType = getContentType();

        if (uri.getPath().startsWith("/apps/public")) {
          httpServeFile(strContType);
        } else {
          if (this.method.equals("POST")
              || strContType.length() == 0
              || strContType.indexOf("application/x-www-form-urlencoded") >= 0) {
            if (dispatch()) {
              requestProcessed = true;
              return;
            }
          }

          if (
          /*this.method == "GET" &&*/ httpGetFile(strContType)) {

            // }else if ( dispatch() ){
          } else {
            respondNotFound(strErr);
          }
        }
      }
      requestProcessed = true;
    }
  }