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


Java Response.getStatusText方法代码示例

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


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

示例1: getErrorCallback

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
protected RestErrorCallback getErrorCallback() {
	return new RestErrorCallback() {

		@Override
		public boolean error(Request request, Throwable throwable) {
			autoMessageBox.hide();
			String message = "";
			int defaultCodeError = Response.SC_NOT_MODIFIED;
			try {
				throw throwable;
			} catch (ResponseException e) {
				Response response = e.getResponse();					
				message = response.getStatusText(); 
				defaultCodeError = response.getStatusCode();
				
			} catch (Throwable t) {
				message = t.getMessage();
			}
			
			messageDialogBuilder.createError(UIMessages.INSTANCE.warning() + " " + defaultCodeError, message).show();
			
			return false;
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:26,代码来源:AbstractGitHubGetListRequest.java

示例2: getErrorCallback

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
private RestErrorCallback getErrorCallback() {
	return new RestErrorCallback() {

		@Override
		public boolean error(Request request, Throwable throwable) {
			autoMessageBox.hide();
			String message = "";
			int defaultCodeError = Response.SC_NOT_MODIFIED;
			try {
				throw throwable;
			} catch (ResponseException e) {
				Response response = e.getResponse();					
				message = response.getStatusText(); 
				defaultCodeError = response.getStatusCode();
				
			} catch (Throwable t) {
				message = t.getMessage();
			}
			
			messageDialogBuilder.createError(UIMessages.INSTANCE.warning() + " " + defaultCodeError, message).show();
			
			return false;
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:26,代码来源:GitHubGetRepositoryListRequest.java

示例3: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
public final void onResponseReceived(final Request request, final Response response) {
  final String text = response.getText();
  if (text.isEmpty()) {
    final int code = response.getStatusCode();
    final String errmsg;
    if (code == 0) {  // Happens when a cross-domain request fails to connect.
      errmsg = ("Failed to connect to " + server + ", check that the server"
                + " is up and that you can connect to it.");
    } else {
      errmsg = ("Empty response from server: code=" + code
                + " status=" + response.getStatusText());
    }
    onError(request, new RuntimeException(errmsg));
  } else {
    JSONValue value;
    try {
      value = JSONParser.parseStrict(text);
    } catch (JSONException e) {
      onError(request, e);
      return;
    }
    onSuccess(value);
  }
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:25,代码来源:Main.java

示例4: getErrorCallback

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
private RestErrorCallback getErrorCallback() {
	return new RestErrorCallback() {

		@Override
		public boolean error(Request request, Throwable throwable) {
			autoMessageBox.hide();
			String message = "";
			int defaultCodeError = Response.SC_NOT_MODIFIED;
			try {
				throw throwable;
			} catch (ResponseException e) {
				Response response = e.getResponse();
				message = response.getStatusText();
				defaultCodeError = response.getStatusCode();

			} catch (Throwable t) {
				message = t.getMessage();
			}

			messageDialogBuilder.createError(
					UIMessages.INSTANCE.warning() + " " + defaultCodeError,
					message).show();

			return false;
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:28,代码来源:GitHubCreateFileExporter.java

示例5: onError

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onError(Response response) {
    String message = "Error calling REST method with status (" + response.getStatusCode() + ": " + response.getStatusText() + ") and text (" +
        response.getText() + ").";
    ErrorPopup.show(message);
    throw new IllegalStateException(message);
}
 
开发者ID:kiegroup,项目名称:optashift-employee-rostering,代码行数:8,代码来源:FailureShownRestCallback.java

示例6: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request nativeRequest, Response nativeResponse)
{
	TransactionRequest request = this.getDispatchedRequest(nativeRequest);
	m_reusedResponse.clear();
	int statusCode = nativeResponse.getStatusCode();
	
	if( statusCode != Response.SC_OK )
	{
		String statusText = nativeResponse.getStatusText();
		m_reusedResponse.setError(E_ResponseError.HTTP_ERROR);
		
		this.onError(nativeRequest, request, m_reusedResponse);
		
		return;
	}
	
	I_JsonObject responseJson = m_jsonFactory.createJsonObject(nativeResponse.getText());
	m_reusedResponse.readJson(m_jsonFactory, responseJson);
	
	if( !(request instanceof TransactionRequestBatch) )
	{
		m_callbacks.onResponseReceived(request, m_reusedResponse);
	}
	else
	{
		if( m_reusedResponse.getError() != E_ResponseError.NO_ERROR )
		{
			this.onError(nativeRequest, request, m_reusedResponse);
			
			return;
		}

		TransactionRequestBatch batch = (TransactionRequestBatch) request;

		I_JsonArray responseList = m_jsonFactory.getHelper().getJsonArray(responseJson, E_JsonKey.responseList);
		
		m_callbacks.onResponseReceived(batch, responseList);
	}
	
	this.m_nativeRequestMap.remove(nativeRequest);
}
 
开发者ID:dougkoellmer,项目名称:swarm,代码行数:43,代码来源:GwtRequestDispatcher.java


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