本文整理汇总了Java中com.google.gwt.http.client.URL.decodeQueryString方法的典型用法代码示例。如果您正苦于以下问题:Java URL.decodeQueryString方法的具体用法?Java URL.decodeQueryString怎么用?Java URL.decodeQueryString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.http.client.URL
的用法示例。
在下文中一共展示了URL.decodeQueryString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UrlParameters
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
UrlParameters(String query) {
if (query.length() > 1) {
String[] keyvalpairs = query.substring(1, query.length()).split("&");
for (String pair : keyvalpairs) {
String[] keyval = pair.split("=");
// Some basic error handling for invalid query params.
String paramUnderlineName = URL.decodeQueryString(keyval[0]);
String paramCamelName = ValueUtils.toCamelCase(paramUnderlineName, "_", false);
String key = FlagConstants.getShortName(paramCamelName);
if (keyval.length == 2) {
String value = URL.decodeQueryString(keyval[1]);
map.put(key, value);
} else if (keyval.length == 1) {
map.put(key, "");
}
}
}
}
示例2: parseToken
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
protected void parseToken(String token) {
for (String kvPair : token.split("[,;&/?]")) {
String[] kv = kvPair.split("=", 2);
if (kv.length != 2 || kv[0].isEmpty()) {
continue;
}
if ("filter".equals(kv[0])) {
match = URL.decodeQueryString(kv[1]);
}
if ("skip".equals(kv[0]) && URL.decodeQueryString(kv[1]).matches("^[\\d]+")) {
start = Integer.parseInt(URL.decodeQueryString(kv[1]));
}
}
}
示例3: loadDataRPC
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
private void loadDataRPC() {
//fetch XML data using server proxy in order to resolve browsers' cross-domain security restrictions
// setStatus("Data is loading...");
String xmlUrl = gadgetSettings.getGadgetXmlUrl();
xmlUrl = URL.decodeQueryString(xmlUrl);
gadgetService.getGadgetXml(xmlUrl, rpcCallBackHandler);
//http://www.roseindia.net/tutorials/gwt/retrieving-xml-data.shtml
// RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, gadgetUrl);
// try {
// requestBuilder.sendRequest(null, new RequestCallback() {
// public void onResponseReceived(Request request, Response response) {
// actionsWidget.setEnabled(true);
// tbName.setText(response.getText());
// bindData();
// statusBox.clear();
// }
// public void onError(Request request, Throwable ex) {
// actionsWidget.setEnabled(true);
// statusBox.setStatus(StatusBoxWidget.Status.ERROR, "Error: " + ex.getMessage());
// }
// });
// } catch (RequestException ex) {
// statusBox.setStatus(StatusBoxWidget.Status.ERROR, "Error: " + ex.getMessage());
// }
}
示例4: GWTFileUploadResponse
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
/**
* GWTFileUploadResponse
*
* @param text json encoded parameters.
*/
public GWTFileUploadResponse(String text) {
text = text.substring(text.indexOf("{"));
text = text.substring(0, text.lastIndexOf("}") + 1);
JSONValue responseValue = JSONParser.parseStrict(text);
JSONObject response = responseValue.isObject();
// Deserialize information
hasAutomation = response.get("hasAutomation").isBoolean().booleanValue();
path = URL.decodeQueryString(response.get("path").isString().stringValue());
error = response.get("error").isString().stringValue();
showWizardCategories = response.get("showWizardCategories").isBoolean().booleanValue();
showWizardKeywords = response.get("showWizardKeywords").isBoolean().booleanValue();
digitalSignature = response.get("digitalSignature").isBoolean().booleanValue();
// Getting property groups
JSONArray groupsArray = response.get("groupsList").isArray();
if (groupsArray != null) {
for (int i = 0; i <= groupsArray.size() - 1; i++) {
groupsList.add(groupsArray.get(i).isString().stringValue());
}
}
// Getting workflows
JSONArray workflowArray = response.get("workflowList").isArray();
if (workflowArray != null) {
for (int i = 0; i <= workflowArray.size() - 1; i++) {
workflowList.add(workflowArray.get(i).isString().stringValue());
}
}
}
示例5: onAttributeModified
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
/**
* Processes changes in the gadget element attributes.
* TODO(user): move some of this code to the handler.
*
* @param name attribute name.
* @param value new attribute value.
*/
public void onAttributeModified(String name, String value) {
log("GW.onAttributeModified");
log("Attribute '", name, "' changed to '", value, "'");
if (userPrefs == null) {
log("Attribute changed before the gadget is initialized.");
return;
}
switch (name) {
case GadgetConstants.URL_ATTRIBUTE:
source = (value == null) ? "" : value;
break;
case GadgetConstants.TITLE_ATTRIBUTE:
String title = (value == null) ? "" : URL.decodeQueryString(value);
if (!title.equals(ui.getTitleLabelText())) {
log("Updating title: ", title);
ui.setTitleLabelText(title);
}
break;
case GadgetConstants.PREFS_ATTRIBUTE:
updatePrefsFromAttribute(value);
break;
case GadgetConstants.STATE_ATTRIBUTE:
StateMap newState = attributeToState(value);
if (!state.compare(newState)) {
String podiumState = newState.get(PODIUM_STATE_NAME);
if ((podiumState != null) && (!podiumState.equals(state.get(PODIUM_STATE_NAME)))) {
GadgetRpcSender.sendPodiumOnStateChangedRpc(getGadgetName(), podiumState);
}
state.clear();
state.copyFrom(newState);
if (shouldLog()) {
log("Updating gadget state: ", state.toJson());
}
gadgetStateSubmitter.submit();
}
break;
}
}
示例6: GroupListScreen
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
public GroupListScreen(String params) {
this();
for (String kvPair : params.split("[,;&]")) {
String[] kv = kvPair.split("=", 2);
if (kv.length != 2 || kv[0].isEmpty()) {
continue;
}
if ("filter".equals(kv[0])) {
match = URL.decodeQueryString(kv[1]);
}
if ("skip".equals(kv[0]) && URL.decodeQueryString(kv[1]).matches("^[\\d]+")) {
start = Integer.parseInt(URL.decodeQueryString(kv[1]));
}
}
}
示例7: getOwnerUUID
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
public final AccountGroup.UUID getOwnerUUID() {
String owner = owner_id();
if (owner != null) {
return new AccountGroup.UUID(URL.decodeQueryString(owner));
}
return null;
}
示例8: urlDecode
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
/**
* URLDecode a string
* @param s
* @return
*/
public static String urlDecode(String s) {
if (s == null || s.isEmpty()) {
return s;
}
return URL.decodeQueryString(s);
}
示例9: decodeURLComponent
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
/**
* @see com.xcurechat.client.utils.EncoderInt#decodeURLComponent(java.lang.String)
*/
@Override
public String decodeURLComponent(final String value) {
return URL.decodeQueryString( value );
}
示例10: initAndShow
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
private void initAndShow() {
// initialize JossoUtil... supply context information
JossoUtil.init(
Application.getInstance().getProperties().getProperty("sso.server.url"),
GWT.getModuleBaseURL(),
Application.getInstance().getProperties().getProperty("sso.user.profile.url")
);
commandTable = creator.makeCommandTable();
toolBar = creator.getToolBar();
layoutManager = creator.makeLayoutManager();
if (creator.isApplication()) {
requestHandler = getRequestHandler();
History.addValueChangeHandler(requestHandler);
}
nullFrame = new Frame();
nullFrame.setSize("0px", "0px");
nullFrame.setVisible(false);
RootPanel root = RootPanel.get();
root.clear();
root.add(nullFrame);
if (BrowserUtil.isTouchInput()) root.addStyleName("disable-select");
if (getLayoutManager()!=null) getLayoutManager().layout(creator.getLoadingDiv());
checkMobilAppInstall();
if (SupportedBrowsers.isSupported()) {
if (appReady != null) {
appReady.ready();
}
if (creator.isApplication()) {
// save the current state when you leave.
DeferredCommand.addCommand(new Command() {
public void execute() {
Window.addCloseHandler(new CloseHandler<Window>() {
public void onClose(CloseEvent<Window> windowCloseEvent) {
gotoUrl(null, false);
}
});
}
});
// coming back from prior session
String ssoBackTo = Cookies.getCookie(PRIOR_STATE);
final Request prevState = Request.parse(ssoBackTo);
if (prevState != null && prevState.isSearchResult()) {
Cookies.removeCookie(PRIOR_STATE);
History.newItem(ssoBackTo, true);
} else {
// url contains request params
String qs = Window.Location.getQueryString().replace("?", "");
if (!StringUtils.isEmpty(qs) && !qs.contains(IGNORE_QUERY_STR)) {
String qsDecoded = URL.decodeQueryString(qs);
String base = Window.Location.getHref();
base = base.substring(0, base.indexOf("?"));
String newUrl = base + "#" + URL.encodePathSegment(qsDecoded);
Window.Location.replace(newUrl);
} else {
String startToken = History.getToken();
if (StringUtils.isEmpty(startToken)) {
goHome();
} else {
requestHandler.processToken(startToken);
}
}
}
if (backgroundMonitor!=null) backgroundMonitor.syncWithCache(null);
}
} else {
hideDefaultLoadingDiv();
SupportedBrowsers.showUnsupportedMessage();
}
}
示例11: projects
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
private static void projects(String token) {
String rest = skip(token);
int c = rest.indexOf(DASHBOARDS);
if (0 <= c) {
final String project = URL.decodePathSegment(rest.substring(0, c));
rest = rest.substring(c);
if (matchPrefix(DASHBOARDS, rest)) {
final String dashboardId = skip(rest);
GerritCallback<DashboardInfo> cb =
new GerritCallback<DashboardInfo>() {
@Override
public void onSuccess(DashboardInfo result) {
if (matchPrefix("/dashboard/", result.url())) {
String params = skip(result.url()).substring(1);
ProjectDashboardScreen dash =
new ProjectDashboardScreen(new Project.NameKey(project), params);
Gerrit.display(token, dash);
}
}
@Override
public void onFailure(Throwable caught) {
if ("default".equals(dashboardId) && RestApi.isNotFound(caught)) {
Gerrit.display(
PageLinks.toChangeQuery(
PageLinks.projectQuery(new Project.NameKey(project))));
} else {
super.onFailure(caught);
}
}
};
if ("default".equals(dashboardId)) {
DashboardList.getDefault(new Project.NameKey(project), cb);
return;
}
c = dashboardId.indexOf(":");
if (0 <= c) {
final String ref = URL.decodeQueryString(dashboardId.substring(0, c));
final String path = URL.decodeQueryString(dashboardId.substring(c + 1));
DashboardList.get(new Project.NameKey(project), ref + ":" + path, cb);
return;
}
}
}
Gerrit.display(token, new NotFoundScreen());
}
示例12: getGroupUUID
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
public final AccountGroup.UUID getGroupUUID() {
return new AccountGroup.UUID(URL.decodeQueryString(id()));
}
示例13: decodeQueryString
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
@Override
public String decodeQueryString(String encodedQueryComponent) {
return URL.decodeQueryString(encodedQueryComponent);
}
示例14: parseDataObjectToEvidence
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
/**
* Parses a given dataobject in xml-form to an evidenceobject.
* @param xml The dataobject as an xml-string.
* @return the parsed evidenceobject.
*/
public static Evidence parseDataObjectToEvidence(String xml) {
Evidence result = null;
if (xml.contains("<") && xml.contains(">") && xml.contains("xmlns=")) {
Element elem = parseXMLStringToElement(xml);
if (elem != null) {
try {
String ns = elem.getNamespaceURI();
if (ns == null || (ns.contains("activityrecommendationapp") && !ns.contains("experience") && !ns.contains("textevidence"))) {
return null;
}
String id = elem.getAttribute("id");
String name = elem.getTagName();
String timestamp = elem.getAttribute("timestamp");
NodeList attachments = elem.getElementsByTagName("attachment");
if (ns.contains("textevidence") && attachments != null && attachments.getLength() == 1) {
Element attachment = (Element)attachments.item(0);
String fileName;
String location;
Element contentElem = (Element) elem.getElementsByTagName("content").item(0);
String content = ((CDATASection)contentElem.getFirstChild()).getData();
if (attachment.hasAttribute("filename")) {
fileName = attachment.getAttribute("filename");
location = attachment.getAttribute("location");
} else {
Element link = (Element) attachment.getFirstChild();
String url = link.getAttribute("url");
location = URL.decodeQueryString(url.split("/")[url.split("/").length - 2]);
fileName = link.getAttribute("id");
}
result = new FileEvidence(id, name, timestamp, content, fileName);
((FileEvidence)result).setLocation(location);
} else {
result = new Evidence(id, name, timestamp, xml);
}
String publisher = null;
result.setNS(ns);
if (elem.hasAttribute("publisher")) {
publisher = elem.getAttribute("publisher");
result.setPublisher(publisher);
}
return result;
} catch (Exception e) {
result = new Evidence(ARApp.uuid(), "text", HasTimestamp.TIMESTAMPFORMAT.format(new Date()), xml);
}
} else {
result = new Evidence(ARApp.uuid(), "text", HasTimestamp.TIMESTAMPFORMAT.format(new Date()), xml);
}
} else {
result = new Evidence(ARApp.uuid(), "text", HasTimestamp.TIMESTAMPFORMAT.format(new Date()), xml);
}
return result;
}
示例15: decodeQueryString
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
@Override
public String decodeQueryString(String encodedURLComponent) {
return URL.decodeQueryString(encodedURLComponent);
}