当前位置: 首页>>代码示例>>Java>>正文


Java RequestBuilder.GET属性代码示例

本文整理汇总了Java中com.google.gwt.http.client.RequestBuilder.GET属性的典型用法代码示例。如果您正苦于以下问题:Java RequestBuilder.GET属性的具体用法?Java RequestBuilder.GET怎么用?Java RequestBuilder.GET使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.gwt.http.client.RequestBuilder的用法示例。


在下文中一共展示了RequestBuilder.GET属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCancel

@Override
public void onCancel(CancelEvent event) {
	if (event.getID().equals("Correlation")) {
		currentURL = currentURL + "&cancel=true";
		RequestBuilder sendRequest = new RequestBuilder(
				RequestBuilder.GET, currentURL);
		try {

			lasAnnotationsPanel
					.setError("Fetching plot annotations...");
			sendRequest.sendRequest(null, lasRequestCallback);
		} catch (RequestException e) {
			Window.alert("Unable to cancel request.");
		}
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:16,代码来源:Correlation.java

示例2: doJsonRequest

private void doJsonRequest(String url, String username, String password, JSONControllerCallback callback, Integer timeout) {
	RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
	Request request = null;
	
	// Add accept header
	builder.setHeader("Accept", "application/json");
	
	if (username != null && username.length() > 0) {
		if (password == null) password = "";
		
		// Add authentication header
		String authStr = username + ":" + password;
		String authEnc = "Basic " + BrowserUtils.base64Encode(authStr);
		builder.setHeader("Authorization", authEnc);
	}
	
	builder.setCallback(callback);
	
	if (timeout != null) {
		builder.setTimeoutMillis(timeout);
	}
	
   try {
 		request = builder.send();
   } catch (RequestException e) {
 		callback.onError(request, e);
   }
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:28,代码来源:JSONControllerConnector.java

示例3: onCancel

@Override
public void onCancel(CancelEvent event) {
    if (event.getID().equals(ID)) {
        currentURL = currentURL + "&cancel=true";
        RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, currentURL);
        try {

            lasAnnotationsPanel.setError("Fetching plot annotations...");
            updating = true;
            // sendRequest.sendRequest(null, 33Callback);
            // Using LASRequestEvent Controller so a cancel in one
            // OutputPanel cancels related requests too
            LASRequestEvent lasRequestEvent = new LASRequestEvent(sendRequest, "lasRequestCallback", getName());
            eventBus.fireEventFromSource(lasRequestEvent, thisOutputPanel);
            // } catch (RequestException e) {
        } catch (Exception e) {
            Window.alert("Unable to cancel request.");
        }
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:OutputPanel.java

示例4: init

public void init(LASRequest request, String cruiseid) {
  	message.setVisible(false);
  	request.setOperation("Cruise_List", "v7");
  	List<Map<String, String>> c = request.getVariableConstraints();
  	for (Iterator cIt = c.iterator(); cIt.hasNext();) {
	Map<String, String> map = (Map<String, String>) cIt.next();
	String varid = map.get("varID");
	if ( varid.equals(cruiseid)) {
		
	} else {
		
	}
}
String url = Util.getProductServer()+"?xml="+URL.encode(request.toString());
  	RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, UriUtils.sanitizeUri(url));
try {
	sendRequest.sendRequest(null, iconListRequestCallback);
} catch (RequestException e) {
	message.setVisible(true);
	message.setHTML("Unable to icon list");
}
  }
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:22,代码来源:CruiseIconWidget.java

示例5: setRequestBuilder

/**
 * @param requestBuilder
 *            the requestBuilder to set
 */
void setRequestBuilder(RequestBuilder requestBuilder) {
	this.requestBuilder = requestBuilder;
	this.url = this.requestBuilder.getUrl();
	String httpMethod = this.requestBuilder.getHTTPMethod();
	if (RequestBuilder.GET.toString().equalsIgnoreCase(httpMethod)) {
		this.method = RequestBuilder.GET;
	} else if (RequestBuilder.POST.toString().equalsIgnoreCase(httpMethod)) {
		this.method = RequestBuilder.POST;
	} else if (RequestBuilder.DELETE.toString().equalsIgnoreCase(httpMethod)) {
		this.method = RequestBuilder.DELETE;
	} else if (RequestBuilder.HEAD.toString().equalsIgnoreCase(httpMethod)) {
		this.method = RequestBuilder.HEAD;
	} else if (RequestBuilder.PUT.toString().equalsIgnoreCase(httpMethod)) {
		this.method = RequestBuilder.PUT;
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:LASRequestEvent.java

示例6: doStop

public void doStop() {
 for (TabItem item : advanced.getItems()) {
	 final CIModel model = (CIModel)item.getData("model");

	 // Do a HTTP request..
	 RequestBuilder req = new RequestBuilder(RequestBuilder.GET, getStopURL(model));

	 try {
		 Info.display("Stop", "Send stop to " + model.getDisplayName());
		 req.sendRequest(null, new RequestCallback() {

			 public void onResponseReceived(Request request, Response response) {
				 Info.display("Stop", "COMPLETED. Stop sent to " + model.getDisplayName());
			 }

			 public void onError(Request arg0, Throwable arg1) {
				 Info.display("Stop", "FAILED. to stop " + model.getDisplayName());
			 }
		 });

	 } catch (RequestException e) {
		 Info.display("Stop", "ERROR. to stop " + model.getDisplayName());
	 } 
 }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:25,代码来源:MDRStartWidget.java

示例7: load

public void load(String url, final String regionName) {
    RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
    try {
        builder.sendRequest(null, new RequestCallback(){
            public void onResponseReceived(com.google.gwt.http.client.Request req, Response res) {
                updateHtml(res.getText(), regionName);
            }

            public void onError(com.google.gwt.http.client.Request request, Throwable exception) {
            }
        });
    } catch (RequestException e) {
        e.printStackTrace();
    }

}
 
开发者ID:lsst,项目名称:firefly,代码行数:16,代码来源:HtmlRegionLoader.java

示例8: ajax

private void ajax(final String resource, final String body,
                  final AjaxCallback callback) {
  final boolean has_body = body != null;
  final RequestBuilder builder =
    new RequestBuilder(has_body ? RequestBuilder.POST : RequestBuilder.GET,
                       server + resource);
  // Doesn't work on Chrome due to ES bug #828.
  //if (has_body) {
  //  builder.setHeader("Content-Type", "application/json");
  //}
  try {
    builder.sendRequest(body, callback);
  } catch (RequestException e) {
    status.setText("Failed to setup AJAX call to " + server + resource
                   + ": " + e);
  }
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:17,代码来源:Main.java

示例9: setAnnotationsHTMLURL

public void setAnnotationsHTMLURL(String url) {
	RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, url);
	try {
		sendRequest.sendRequest(null, annotationsHTMLCallback);
	} catch (RequestException e) {
		
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:LASAnnotationsButton.java

示例10: setAnnotationsHTMLURL

public void setAnnotationsHTMLURL(String url) {
	RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, UriUtils.sanitizeUri(url));
	try {
		sendRequest.sendRequest(null, annotationsHTMLCallback);
	} catch (RequestException e) {
		e.printStackTrace();
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:LASAnnotationsPanel.java

示例11: PrintPanel

public PrintPanel(String url) {
	RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
	initWidget(panel);
	try {
		builder.sendRequest(null, fillPanelCallback);
	} catch (RequestException e) {
		HTMLPanel html = new HTMLPanel("<b>Unable to retrieve image.</b>");		
		panel.add(html);
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:PrintPanel.java

示例12: updatePlot

private void updatePlot(boolean addHistory, boolean cache) {
    // TODO Before submitting...

    
    setConstraints();
    
    //TODO this should wait until the result comes back and is good and should be an event, right?
    update.removeStyleDependentName("APPLY-NEEDED");

    lasAnnotationsPanel.setError("Fetching plot...");

    spin.setPopupPosition(outputPanel.getAbsoluteLeft(), outputPanel.getAbsoluteTop());
    spin.show();

    makeRequest(true);
   
    imageCanvas = Canvas.createIfSupported();
    drawingCanvas = Canvas.createIfSupported();

    
    
    if (imageCanvas != null) {

        canvasDiv.add(imageCanvas, 0, 0);
        canvasDiv.add(drawingCanvas, 0, 0);
        outputPanel.setWidget(1, 0, canvasDiv);
        imageCanvasContext = imageCanvas.getContext2d();
        drawingCanvasContext = drawingCanvas.getContext2d();
        
    } else {
        outputPanel.setWidget(1, 0 , new HTML(""));
        Window.alert("You are accessing this site with an older, no longer supported browser. "
                + "Some or all features of this site will not work correctly using your browser. " + "Recommended browsers include these or higher versions of these: "
                + "IE 9.0   FF 17.0    Chorme 23.0    Safari 5.1");
    }

    String url = Util.getProductServer() + "?xml=" + URL.encode(lasRequest.toString());

    currentURL = url;
    
    if ( cache ) {
        lasRequest.setProperty("product_server", "use_cache", "true");
    } else {
        lasRequest.setProperty("product_server", "use_cache", "false");
    }

    if (addHistory) {
        String x = lasRequest.toString();
        pushHistory(x);
    }

    RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, url);
    try {
        sendRequest.sendRequest(null, lasRequestCallback);
    } catch (RequestException e) {
        HTML error = new HTML(e.toString());
        outputPanel.setWidget(2, 0, error);
    }

}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:60,代码来源:SimplePropPropViewer.java

示例13: onCancel

@Override
public void onCancel(CancelEvent event) {
    if (event.getID().equals("Correlation")) {
        currentURL = currentURL + "&cancel=true";
        RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, currentURL);
        try {

            lasAnnotationsPanel.setError("Fetching plot annotations...");
            sendRequest.sendRequest(null, lasRequestCallback);
        } catch (RequestException e) {
            Window.alert("Unable to cancel request.");
        }
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:14,代码来源:SimplePropPropViewer.java

示例14: sendPlot

private void sendPlot(LASRequest lr0) {
    currentRequest = lr0;
    String url = Util.getProductServer() + "?xml=" + URL.encode(lr0.toString());
    RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, url);
    try {
        sendRequest.sendRequest(null, lasRequestCallback);
    } catch (RequestException e) {
        Window.alert("Unable to make plot requests.");
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:ThumbnailPropProp.java

示例15: run

protected void run() {
  if (!gssLoaded.contains(url)) {
    RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
    try {
      rb.sendRequest("", this);
    } catch (Exception e) {
      next();
    }
  } else {
    next();
  }
}
 
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:12,代码来源:GssStyleElementGssContext.java


注:本文中的com.google.gwt.http.client.RequestBuilder.GET属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。