Package com.google.gwt.http.client

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


       * 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()));
      }
      // Replace "%3A" with ":" as a hack to support broken DevMode plugins.
      Window.Location.replace(builder.buildString().replaceAll("%3A", ":"));
      currentBlock = null;
      currentTestIndex = 0;
    }
  }
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

      }
    }
    localeBox.addChangeHandler(new ChangeHandler() {
      public void onChange(ChangeEvent event) {
        String localeName = localeBox.getValue(localeBox.getSelectedIndex());
        UrlBuilder builder = Location.createUrlBuilder().setParameter("locale",
            localeName);
        Window.Location.replace(builder.buildString());
      }
    });
    HorizontalPanel localeWrapper = new HorizontalPanel();
    localeWrapper.add(new Image(images.locale()));
    localeWrapper.add(localeBox);
View Full Code Here

                        removeHMParameter();
                    }
                }

                private void addHMParameter() {
                    UrlBuilder createUrlBuilder = Location.createUrlBuilder();
                    createUrlBuilder.setParameter("gwt.codesvr",
                            "localhost:9997");
                    Location.assign(createUrlBuilder.buildString());
                }

                private void removeHMParameter() {
                    UrlBuilder createUrlBuilder = Location.createUrlBuilder();
                    createUrlBuilder.removeParameter("gwt.codesvr");
                    Location.assign(createUrlBuilder.buildString());

                }
            });

            autoScroll
View Full Code Here

                        removeHMParameter();
                    }
                }

                private void addHMParameter() {
                    UrlBuilder createUrlBuilder = Location.createUrlBuilder();
                    createUrlBuilder.setParameter("gwt.codesvr",
                            "localhost:9997");
                    Location.assign(createUrlBuilder.buildString());
                }

                private void removeHMParameter() {
                    UrlBuilder createUrlBuilder = Location.createUrlBuilder();
                    createUrlBuilder.removeParameter("gwt.codesvr");
                    Location.assign(createUrlBuilder.buildString());

                }
            });

            autoScroll
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) {
        // Decode the hash now, because UrlBuilder.buildString() later encodes it.
        builder.setHash(URL.decodeQueryString(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

                        removeHMParameter();
                    }
                }

                private void addHMParameter() {
                    UrlBuilder createUrlBuilder = Location.createUrlBuilder();
                    createUrlBuilder.setParameter("gwt.codesvr",
                            "localhost:9997");
                    Location.assign(createUrlBuilder.buildString());
                }

                private void removeHMParameter() {
                    UrlBuilder createUrlBuilder = Location.createUrlBuilder();
                    createUrlBuilder.removeParameter("gwt.codesvr");
                    Location.assign(createUrlBuilder.buildString());

                }
            });

            autoScroll
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

    {
      Window.Location.replace(connectionReturn.getRedirectURL());
    }
    else if (connectionReturn != null && connectionReturn.getNewLanguageIsocode() != null)
    {
      final UrlBuilder builder = Location.createUrlBuilder().setParameter("locale", connectionReturn.getNewLanguageIsocode());
      Window.Location.replace(builder.buildString());
    }
    else if (connectionReturn == null || connectionReturn.getUser() == null)
    {
      currentChainAction.stopChain();
      MyMessageBox.alert(DkMain.i18n().message_ConnectionFailed_title(), DkMain.i18n()
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.