本文整理汇总了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.");
}
}
}
示例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);
}
}
示例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.");
}
}
}
示例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");
}
}
示例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;
}
}
示例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());
}
}
}
示例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();
}
}
示例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);
}
}
示例9: setAnnotationsHTMLURL
public void setAnnotationsHTMLURL(String url) {
RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, url);
try {
sendRequest.sendRequest(null, annotationsHTMLCallback);
} catch (RequestException e) {
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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.");
}
}
}
示例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.");
}
}
示例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();
}
}