Package com.google.gwt.http.client

Examples of com.google.gwt.http.client.UrlBuilder


        {
            String path = Window.Location.getPath();
            int index = path.lastIndexOf('/');
            if (index >= 0 && path.length() > index + 1)
            {
                UrlBuilder builder = new UrlBuilder();
                builder.setProtocol(Window.Location.getProtocol());
                builder.setHost(Window.Location.getHost());
                try
                {
                    builder.setPort(Integer.parseInt(Window.Location.getPort()));
                }
                catch (Exception ex)
                {
                    int makeCheckstyleShutUp = 1;
                }
                builder.setPath(path.substring(0, index));
                mainAppLaunchUrl = builder.buildString();
            }
        }
    }
View Full Code Here


    return this;
  }
 
  protected void changeLanguage(String lang) {
    //Window.alert("Work in progress ...");
    UrlBuilder builder = Location.createUrlBuilder()
      .setParameter("locale", lang);
    Window.Location.replace(builder.buildString());
  }
View Full Code Here

    }

    String path = Location.getPath();
    path = path.replaceAll("refineview.html", "");

    UrlBuilder b = Location.createUrlBuilder();

    b.setPath(path + "stop.action");

    b.setParameter("id", _stopsById.keySet().toArray(new String[0]));

    if (!allRoutesSelected)
      b.setParameter("route", routeIds.toArray(new String[0]));

    Location.replace(b.buildString());
  }
View Full Code Here

     * Create a {@link UrlBuilder} based on this {@link Location}.
     *
     * @return the new builder
     */
    public static UrlBuilder createUrlBuilder() {
      UrlBuilder builder = new UrlBuilder();
      builder.setProtocol(getProtocol());
      builder.setHost(getHost());
      String path = getPath();
      if (path != null && path.length() > 0) {
        builder.setPath(path);
      }
      String hash = getHash();
      if (hash != null && hash.length() > 0) {
        builder.setHash(hash);
      }
      String port = getPort();
      if (port != null && port.length() > 0) {
        builder.setPort(Integer.parseInt(port));
      }

      // Add query parameters.
      Map<String, List<String>> params = getParameterMap();
      for (Map.Entry<String, List<String>> entry : params.entrySet()) {
        List<String> values = new ArrayList<String>(entry.getValue());
        builder.setParameter(entry.getKey(),
            values.toArray(new String[values.size()]));
      }

      return builder;
    }
View Full Code Here

       * the same path suffix (e.g., '/junit.html') as the current URL.
       */
      String currentPath = Window.Location.getPath();
      String pathSuffix = currentPath.substring(currentPath.lastIndexOf('/'));
     
      UrlBuilder builder = Window.Location.createUrlBuilder();
      builder.setParameter(BLOCKINDEX_QUERY_PARAM,
          Integer.toString(currentBlock.getIndex())).setPath(
          newModule + pathSuffix);
      // Hand off the session id to the next module.
      if (clientInfo.getSessionId() >= 0) {
        builder.setParameter(SESSIONID_QUERY_PARAM,
            String.valueOf(clientInfo.getSessionId()));
      }
      Window.Location.replace(builder.buildString());
      currentBlock = null;
      currentTestIndex = 0;
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.http.client.UrlBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.