private void redirectToModule(String module) { String path = Window.Location.getPath(); if (!path.endsWith("/")) { if (path.endsWith(".html") || path.endsWith(".htm")) { int index = path.lastIndexOf('/'); path = path.substring(0, index + 1); } else { path += "/"; } } String target = path + module + "/"; Window.Location.assign(Window.Location.createUrlBuilder().setPath(target).buildString()); }
/** * Redirect to module. * * @param module the module name. */ public static void redirectToModule(String module) { String path = Window.Location.getPath(); if (!path.endsWith("/")) { if (path.endsWith(".html") || path.endsWith(".htm")) { int index = path.lastIndexOf('/'); path = path.substring(0, index + 1); } else { path += "/"; } } String target = path + module + "/"; Window.Location.assign(Window.Location.createUrlBuilder().setPath(target).buildString()); }
String path = getPath(); if (path != null && path.length() > 0) { builder.setPath(path);
@Override public IsUrlBuilder setPath(String path) { b.setPath(path); return this; }
String path = getPath(); if (path != null && path.length() > 0) { builder.setPath(path);
String path = getPath(); if (path != null && path.length() > 0) { builder.setPath(path);
UrlBuilder u = new UrlBuilder(); u.setProtocol("https"); u.setHost("www.mysite.com:8080"); u.setPath("/myServletPath"); u.setParameter("username", nameField.getValue()); u.setParameter("someAttribute", "itsValue"); u.buildString();
@Override public void addGraphToReport(final RequestCallback callback, final int kscReportId, final String graphTitle, final String graphName, final String resourceId, final String timeSpan) { UrlBuilder builder = new UrlBuilder(); builder.setPath(BASE_URL + "/" + kscReportId); builder.setParameter("title", graphTitle); builder.setParameter("reportName", graphName); builder.setParameter("resourceId", resourceId); builder.setParameter("timespan", timeSpan); // we just want a relative URL, so we render it and strip the beginning :) final String url = builder.buildString().replace("http:///", ""); GWT.log("making request: " + url); sendRequest(callback, RequestBuilder.PUT, url); }