當前位置: 首頁>>代碼示例>>Java>>正文


Java URL.encodeQueryString方法代碼示例

本文整理匯總了Java中com.google.gwt.http.client.URL.encodeQueryString方法的典型用法代碼示例。如果您正苦於以下問題:Java URL.encodeQueryString方法的具體用法?Java URL.encodeQueryString怎麽用?Java URL.encodeQueryString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.http.client.URL的用法示例。


在下文中一共展示了URL.encodeQueryString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createUrlToShare

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
private SelectHandler createUrlToShare(final VerticalPanel geoDataContainer) {
	return new SelectHandler() {
		@Override
		public void onSelect(SelectEvent event) {
			urlToShareAnchor.setHref(getHref());
			urlToShareAnchor.setText(
					UIMessages.INSTANCE.seeOtherWindow("GeoWE Project"),
					Direction.LTR);

			urlShared.setText(getHref());
			urlPanel.setVisible(true);
			urlShared.setVisible(true);
		}

		private String getHref() {
			String baseUrl = GWT.getHostPageBaseURL();

			baseUrl += "?projectUrl="
					+ URL.encodeQueryString(urlTextField.getValue());

			return baseUrl;
		}
	};
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:25,代碼來源:OpenProjectDialog.java

示例2: addDocumentToWikiEditor

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
 * addDocument
 */
private void addDocumentToWikiEditor() {
	if (selectedRow >= 0) {
		String uuid = documentTable.getText(selectedRow, 2);
		String name = UtilComunicator.getName(documentTable.getText(selectedRow, 1));

		switch (type) {
			case FIND_DOCUMENT:
				Wiki.get().addDocumentTag(uuid, name);
				break;

			case FIND_IMAGE:
				String url = RPCService.DownloadServlet;
				url += "?uuid=" + URL.encodeQueryString(uuid);
				Wiki.get().addImageTag(url, getParameters());
				break;
		}
	}
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:22,代碼來源:FindDocumentSelectPopup.java

示例3: addDocumentToHTMLEditor

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
 * addDocument
 */
private void addDocumentToHTMLEditor() {
	if (selectedRow >= 0) {
		String uuid = documentTable.getText(selectedRow, 2);
		String name = UtilComunicator.getName(documentTable.getText(selectedRow, 1));

		switch (type) {
			case FIND_DOCUMENT:
				addDocumentHTMLEditor(uuid, name);
				break;

			case FIND_IMAGE:
				String downloadServletName = RPCService.DownloadServlet.substring(RPCService.DownloadServlet.lastIndexOf("/") + 1);
				String url = "./" + downloadServletName;
				url += "?uuid=" + URL.encodeQueryString(uuid);
				addImageHTMLEditor(url, getParameters());
				break;
		}
	}
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:23,代碼來源:FindDocumentSelectPopup.java

示例4: downloadFiles

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
 * Download files exported as zip
 *
 * @author danilo
 */
@Deprecated
public static void downloadFiles(List<String> path, String params) {
	if (!params.equals("")) {
		params = "&" + params;
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?export" + params;

	for (String p : path) {
		url += "&pathList=" + URL.encodeQueryString(p);
	}

	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:21,代碼來源:Util.java

示例5: showEmbedPDF

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
 * showEmbedPDF
 *
 * @param uuid Unique document ID to be previewed.
 */
public void showEmbedPDF(String uuid) {
	hideWidgetExtension();
	vPanel.clear();

	if (previewEvent != null) {
		vPanel.add(hReturnPanel);
		vPanel.setCellHeight(hReturnPanel, String.valueOf(TURN_BACK_HEIGHT) + "px");
	}

	vPanel.add(pdf);
	vPanel.setCellHorizontalAlignment(pdf, HasAlignment.ALIGN_CENTER);
	vPanel.setCellVerticalAlignment(pdf, HasAlignment.ALIGN_MIDDLE);

	if (previewAvailable) {
		String url = RPCService.DownloadServlet + "?inline=true&uuid=" + URL.encodeQueryString(uuid);
		pdf.setHTML("<div id=\"pdfembededcontainer\">" +
				"<object id=\"" + pdfID + "\" name=\"" + pdfID + "\" width=\"" + width + "\" height=\"" + height + "\" type=\"application/pdf\" data=\"" + url + "\"&#zoom=85&scrollbar=1&toolbar=1&navpanes=1&view=FitH\">" +
				"<p>Browser plugin suppport error, PDF can not be displayed</p>" +
				"</object>" +
				"</div>\n"); // needed for rewriting  purpose
	} else {
		swf.setHTML("<div id=\"pdfembededcontainer\" align=\"center\"><br><br>" + Main.i18n("preview.unavailable") + "</div>\n");
	}
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:30,代碼來源:Preview.java

示例6: buildQueryString

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
 * Build a query string out of a map of key/value pairs.
 * @param queryEntries
 */
public static String buildQueryString(Map<String, String> queryEntries) {
  StringBuilder sb = new StringBuilder();
  boolean firstIteration = true;
  for (Entry<String, String> e : queryEntries.entrySet()) {
    if (firstIteration) {
      sb.append('?');
    } else {
      sb.append('&');
    }
    String encodedName = URL.encodeQueryString(e.getKey());
    sb.append(encodedName);

    sb.append('=');

    String encodedValue = URL.encodeQueryString(e.getValue());
    sb.append(encodedValue);
    firstIteration = false;
  }
  return sb.toString();
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:25,代碼來源:UrlParameters.java

示例7: downloadUsageData

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
private ClickHandler downloadUsageData() {
    return new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            String from = DATE_FORMAT.format(readDateFromFormItem(datesForm.getItem("From")));
            String to = DATE_FORMAT.format(readDateFromFormItem(datesForm.getItem("To")));

            String url = GWT.getModuleBaseURL() + "usageexporter";
            url += "?sessionId=" + LoginModel.getInstance().getSessionId();
            url += "&user=" + userSelect.getValue().toString();
            url += "&startDate=" + URL.encodeQueryString(from);
            url += "&endDate=" + URL.encodeQueryString(to);
            Window.open(url, "_blank", "");
        }
    };
}
 
開發者ID:ow2-proactive,項目名稱:scheduling-portal,代碼行數:17,代碼來源:UsageView.java

示例8: asUriPart

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
 * Construct encoded URI part from gives values.
 *
 * @param separator the separator of parameters from current URI part
 * @param name      the parameter name
 * @param values    the parameter value(s), each object will be converted to a {@code String} using its {@code
 *                  toString()} method.
 *
 * @return encoded URI part
 */
@Override
public String asUriPart(String separator, String name, Object... values) {
    assertNotNullOrEmpty(name, "Parameter name cannot be null or empty.");
    String uriPart = "";
    String sep = "";
    for (Object value : values) {
        String strValue = value.toString();
        assertNotNullOrEmpty(strValue, "Parameter value of *" + name
                + "* null or empty. You must inform a valid value");

        uriPart += sep + URL.encodeQueryString(name) + "=" + URL.encodeQueryString(strValue);
        sep = separator;
    }
    return uriPart;
}
 
開發者ID:growbit,項目名稱:turbogwt-http,代碼行數:26,代碼來源:MultivaluedParamComposition.java

示例9: show

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public void show(Command onSave, WidgetSettingsInfo widgetSettings) {
//		this.onSave = onSave;
		this.widgetSettings = widgetSettings;
		
		String url = widgetSettings.getWidgetUiUrl();
		url += url.contains("?") ? "&" : "?";
		url += "up_id=" + "if_divEditor";
		url += "&parent=" + URL.encodeQueryString(Window.Location.getHref());
		url += "&up_rsW=" + PresentationLayoutWidget.getInstance().getPlaceholderWidth();
		url += "&up_rsH=" + PresentationLayoutWidget.getInstance().getPlaceholderHeight();
		url += "&up_companyId=" + SelectedCompanyController.getInstance().getSelectedCompanyId();
		
		url = url.replace("'", "\\'");

//		String params = widgetSettings.getAdditionalParams() != null ? widgetSettings.getAdditionalParams() : "";
//		params = params.replace("\"", "\\\"");
		
		show(url);
	}
 
開發者ID:Rise-Vision,項目名稱:rva,代碼行數:20,代碼來源:WidgetCustomUIWidget.java

示例10: getFinancialData

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public static void getFinancialData(String urlToken, String tq, DataResponseBase response, boolean customQuery) {
		String action = configController.getConfiguration().getFinancialServerURL() + urlToken;
//		String action = "http://contentfinancial2.appspot.com" + urlToken;
		
		String callback = "callback" + (int)(Math.random() * 1000000) + "_" + new Date().getTime();
		String tqx = "responseHandler:" + callback;
		
		String url = action + "?tqx=" + tqx + "&";
		if (customQuery) {
			url += tq;
		}
		else {
			url += "tq=" + URL.encodeQueryString(tq);
		}
		
		getDataNative(url, callback, response);
		
	}
 
開發者ID:Rise-Vision,項目名稱:rva,代碼行數:19,代碼來源:DataAccessController.java

示例11: show

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public void show(String storePath, Command onSave, Command onCancel){
	this.onSave = onSave;
	this.onCancel = onCancel;
	
	String url = ConfigurationController.getInstance().getConfiguration().getStoreURL();
	url += storePath;
	url += "?inRVA=true&cat=Content&cid=" + SelectedCompanyController.getInstance().getSelectedCompanyId();
	url += "&up_id=" + "if_divEditor";
	url += "&parent=" + URL.encodeQueryString(Window.Location.getHref());

	this.getElement().getStyle().clearBackgroundColor();
	
	this.getElement().addClassName("responsive-iframe");

	show(url);
}
 
開發者ID:Rise-Vision,項目名稱:rva,代碼行數:17,代碼來源:StoreContentFrameWidget.java

示例12: export

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
void export(String type) {
	RoomCookie cookie = RoomCookie.getInstance();
	String query = "output=" + type;
	FilterRpcRequest requests = iFilterBox.getElementsRequest();
	if (requests.hasOptions()) {
		for (Map.Entry<String, Set<String>> option: requests.getOptions().entrySet()) {
			for (String value: option.getValue()) {
				query += "&r:" + option.getKey() + "=" + URL.encodeQueryString(value);
			}
		}
	}
	if (requests.getText() != null && !requests.getText().isEmpty()) {
		query += "&r:text=" + URL.encodeQueryString(requests.getText());
	}
	query += "&sort=" + InstructorCookie.getInstance().getSortTeachingRequestsBy(iAssigned) +
			"&columns=" + InstructorCookie.getInstance().getTeachingRequestsColumns(iAssigned) + 
			"&grid=" + (cookie.isGridAsText() ? "0" : "1") +
			"&vertical=" + (cookie.areRoomsHorizontal() ? "0" : "1") +
			(cookie.hasMode() ? "&mode=" + cookie.getMode() : "");
	RPC.execute(EncodeQueryRpcRequest.encode(query), new AsyncCallback<EncodeQueryRpcResponse>() {
		@Override
		public void onFailure(Throwable caught) {
		}
		@Override
		public void onSuccess(EncodeQueryRpcResponse result) {
			ToolBox.open(GWT.getHostPageBaseURL() + "export?q=" + result.getQuery());
		}
	});
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:30,代碼來源:TeachingRequestsPage.java

示例13: export

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
void export(String type) {
	RoomCookie cookie = RoomCookie.getInstance();
	String query = "output=" + type;
	FilterRpcRequest requests = iFilterBox.getElementsRequest();
	if (requests.hasOptions()) {
		for (Map.Entry<String, Set<String>> option: requests.getOptions().entrySet()) {
			for (String value: option.getValue()) {
				query += "&r:" + option.getKey() + "=" + URL.encodeQueryString(value);
			}
		}
	}
	if (requests.getText() != null && !requests.getText().isEmpty()) {
		query += "&r:text=" + URL.encodeQueryString(requests.getText());
	}
	query += "&sort=" + InstructorCookie.getInstance().getSortTeachingAssignmentsBy() +
			"&columns=" + InstructorCookie.getInstance().getTeachingAssignmentsColumns() + 
			"&grid=" + (cookie.isGridAsText() ? "0" : "1") +
			"&vertical=" + (cookie.areRoomsHorizontal() ? "0" : "1") +
			(cookie.hasMode() ? "&mode=" + cookie.getMode() : "");
	RPC.execute(EncodeQueryRpcRequest.encode(query), new AsyncCallback<EncodeQueryRpcResponse>() {
		@Override
		public void onFailure(Throwable caught) {
		}
		@Override
		public void onSuccess(EncodeQueryRpcResponse result) {
			ToolBox.open(GWT.getHostPageBaseURL() + "export?q=" + result.getQuery());
		}
	});
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:30,代碼來源:TeachingAssignmentsPage.java

示例14: toString

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public String toString(String skip) {
	String ret = "";
	for (String key: new TreeSet<String>(iParams.keySet())) {
		if (key.equals(skip)) continue;
		if (!ret.isEmpty()) ret += "&";
		ret += key + "=" + URL.encodeQueryString(iParams.get(key));
	}
	return ret;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:10,代碼來源:RoomsPage.java

示例15: getQuery

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public String getQuery() {
	String query = "";
	for (FilterParameterInterface param: iFilter.getParameters()) {
		String value = param.getValue();
		if (value != null)
			query += "&" + param.getName() + "=" + URL.encodeQueryString(value);
	}
	return query;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:10,代碼來源:PageFilter.java


注:本文中的com.google.gwt.http.client.URL.encodeQueryString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。