コード例 #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");
  }
コード例 #2
0
ファイル: SyncNotify.java プロジェクト: LittleForker/rhodes
    SyncNotification(String strUrl, String strParams, boolean bRemoveAfterFire) {
      if (strUrl.length() > 0) m_strUrl = RhodesApp.getInstance().canonicalizeRhoUrl(strUrl);

      m_strParams = strParams;
      m_bRemoveAfterFire = bRemoveAfterFire;
    }
コード例 #3
0
ファイル: BrowserAdapter.java プロジェクト: rrmartins/rhodes
  public HttpConnection getResource(RequestedResource resource, BrowserContent referrer) {

    if (resource == null) return null;

    String url = resource.getUrl();
    if (url == null || url.endsWith("/favicon.ico")) return null;

    try {
      if (referrer == null || URI.isLocalData(url) || !m_bLoadImageAsync) {
        boolean bLocalHost = RhodesApp.getInstance().isRhodesAppUrl(url);
        if (bLocalHost && m_connResource != null) {
          com.rho.net.RhoConnection rhoConn =
              (com.rho.net.RhoConnection)
                  ((com.rho.net.bb.NativeBBHttpConnection) m_connResource).getNativeConnection();
          rhoConn.resetUrl(url);

          Utilities.makeConnection(url, resource.getRequestHeaders(), null, m_connResource);
          return m_connResource;
        } else {
          HttpConnection connection =
              Utilities.makeConnection(url, resource.getRequestHeaders(), null, null);
          // if (bLocalHost)
          //	m_connResource = connection;
          return connection;
        }
      } else {
        SecondaryResourceFetchThread.enqueue(resource, referrer);
      }
    } catch (Exception exc) {
      LOG.ERROR("getResource failed.", exc);
    }

    return null;

    /*
     // check if this is cache-only request
     if (resource.isCacheOnly()) {
         // no cache support
         return null;
     }

     String url = resource.getUrl();

     if (url == null) {
         return null;
     }

     try{
      // if referrer is null we must return the connection
      if (referrer == null) {
          HttpConnection connection = Utilities.makeConnection(url, resource.getRequestHeaders(), null);
          return connection;

      } else
      {
    if ( URI.isLocalHost(url) || URI.isLocalData(url))
    {
              HttpConnection connection = Utilities.makeConnection(url, resource.getRequestHeaders(), null);
              return connection;
    }else
    {
           // if referrer is provided we can set up the connection on a separate thread
           SecondaryResourceFetchThread.enqueue(resource, referrer);
    }
      }
     }catch(Exception exc)
     {
     	LOG.ERROR("getResource failed.", exc);
     }

     return null;*/
  }