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


Java RequestBuilder.sendRequest方法代码示例

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


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

示例1: onCancel

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
@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,代码行数:17,代码来源:Correlation.java

示例2: init

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:23,代码来源:CruiseIconWidget.java

示例3: doStop

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:26,代码来源:MDRStartWidget.java

示例4: load

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:17,代码来源:HtmlRegionLoader.java

示例5: sendRequest

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
@Override
public void sendRequest(int timeout, @Nullable String user, @Nullable String password, @Nullable Headers headers,
                        RequestBuilder.Method method, String url, String data, RequestCallback callback)
        throws RequestException {
    final RequestBuilder requestBuilder = new RequestBuilder(method, url);
    if (timeout > 0) requestBuilder.setTimeoutMillis(timeout);
    if (user != null) requestBuilder.setUser(user);
    if (password != null) requestBuilder.setPassword(password);
    if (user != null && password != null) requestBuilder.setIncludeCredentials(true);
    if (headers != null) {
        for (Header header : headers) {
            requestBuilder.setHeader(header.getName(), header.getValue());
        }
    }
    requestBuilder.sendRequest(data, callback);
}
 
开发者ID:growbit,项目名称:turbogwt-http,代码行数:17,代码来源:ServerConnectionImpl.java

示例6: ajax

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:18,代码来源:Main.java

示例7: setAnnotationsHTMLURL

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
public void setAnnotationsHTMLURL(String url) {
	RequestBuilder sendRequest = new RequestBuilder(RequestBuilder.GET, url);
	try {
		sendRequest.sendRequest(null, annotationsHTMLCallback);
	} catch (RequestException e) {
		
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:9,代码来源:LASAnnotationsButton.java

示例8: setAnnotationsHTMLURL

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:9,代码来源:LASAnnotationsPanel.java

示例9: PrintPanel

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:11,代码来源:PrintPanel.java

示例10: updatePlot

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:61,代码来源:SimplePropPropViewer.java

示例11: onCancel

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
@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,代码行数:15,代码来源:SimplePropPropViewer.java

示例12: sendPlot

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:11,代码来源:ThumbnailPropProp.java

示例13: run

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
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,代码行数:13,代码来源:GssStyleElementGssContext.java

示例14: sendJSON

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
private <T extends JavaScriptObject> void sendJSON(
    Method method, JavaScriptObject content, HttpCallback<T> cb) {
  HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
  try {
    if (!background) {
      RpcStatus.INSTANCE.onRpcStart();
    }
    RequestBuilder req = request(method);
    req.setHeader("Content-Type", JSON_UTF8);
    req.sendRequest(str(content), httpCallback);
  } catch (RequestException e) {
    httpCallback.onError(null, e);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:RestApi.java

示例15: sendText

import com.google.gwt.http.client.RequestBuilder; //导入方法依赖的package包/类
private <T extends JavaScriptObject> void sendText(
    Method method, String body, HttpCallback<T> cb) {
  HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
  try {
    if (!background) {
      RpcStatus.INSTANCE.onRpcStart();
    }
    RequestBuilder req = request(method);
    req.setHeader("Content-Type", TEXT_UTF8);
    req.sendRequest(body, httpCallback);
  } catch (RequestException e) {
    httpCallback.onError(null, e);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:RestApi.java


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