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


Java Response.getText方法代码示例

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


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

示例1: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {
    String text = response.getText();
    PopupPanel popup = new PopupPanel(true);
    popup.add(new HTML("<strong>Saved edits for:<p></p></strong>"+text+"<p></p>Click outside box to dismiss."));
    popup.setPopupPosition(200, Window.getClientHeight()/3);
    popup.show();
    CellFormatter formatter = datatable.getCellFormatter();
    for (Iterator dirtyIt = dirtyrows.keySet().iterator(); dirtyIt.hasNext();) {
        Integer widgetrow = (Integer) dirtyIt.next();
        for (int i = 0; i < headers.length; i++) {
            formatter.removeStyleName(widgetrow, i, "dirty");
        }
        
        CheckBox box = (CheckBox) datatable.getWidget(widgetrow, 0);
        box.setValue(false);
    }
    dirtyrows.clear();
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:ColumnEditorWidget.java

示例2: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {
    if (isSuccessStatusCode(response)) {
        if (null != callback) {
            R result;
            if (null != responseConverter && null != response.getText() && !response.getText().isEmpty()) {
                try {
                    result = responseConverter.read(response.getText());
                } catch (Exception e) {
                    onError(request, e);
                    return;
                }
            } else {
                result = null;
            }
            callback.onSuccess(response, result);
        }
    } else {
        if (null != callback) {
            callback.onError(response);
        } else {
            throw new RestException("An error occured. Status : " + response.getStatusCode());
        }
    }
}
 
开发者ID:nmorel,项目名称:gwt-jackson-rest,代码行数:26,代码来源:RestRequestCallback.java

示例3: afterClientErrorHandled

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override public void afterClientErrorHandled(Method method, Request request, Response response) {
    String errorMessage;
    switch (response.getStatusCode()) {
        case 0:
            return; // Ignore
        case 401: // Unauthorized
            placeManager.revealDefaultPlace();
            errorMessage = "Для просмотра данной страницы необходимо войти в систему.";
            break;
        case 404: // Not found
            errorMessage = "Объект не найден.";
            break;
        default:
            errorMessage = "HTTP response error: " + response.getText();
            Window.alert("Обработка запроса завершилась ошибкой. " +
                "Подробная информация об ошибке доступна в консоли браузера. " +
                "Пожалуйста, обновите текущую страницу или начните с главной.");
    }

    log.severe(errorMessage);
}
 
开发者ID:Unisay,项目名称:preferanser,代码行数:22,代码来源:ErrorHandlingRestyGwtRequestListener.java

示例4: 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

示例5: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
public void onResponseReceived(Request request, Response response) {
  hasSession = true;
  try {
    String s = Utils.getXmlNodeValue(XMLParser.parse(response.getText()), TAG_BLOBSTORE);
    blobstore = "true".equalsIgnoreCase(s);
    // with blobstore status does not make sense
    if (blobstore) {
      updateStatusTimer.setInterval(5000);
    }
    uploadForm.submit();
  } catch (Exception e) {
    String message = e.getMessage().contains("error:") 
        ? i18nStrs.uploaderServerUnavailable() + " (3) " + getServletPath() + "\n\n" + i18nStrs.uploaderServerError() + "\nAction: " + getServletPath() + "\nException: " + e.getMessage() + response.getText()
        : i18nStrs.submitError();
    cancelUpload( message);
  }
}
 
开发者ID:mwl,项目名称:gwt-upload,代码行数:18,代码来源:Uploader.java

示例6: 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

示例7: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {

	String text = response.getText();
	setAnnotationsHTML(text);
	eventBus.fireEventFromSource(new ResizeEvent(), LASAnnotationsPanel.this);

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

示例8: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {
	String doc = response.getText();
	if ( doc != null && !doc.equals("") && doc.contains("<?xml") ) {
	    load(doc);
	}
          setCheckedIcons(checkedIcons);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:9,代码来源:CruiseIconWidget.java

示例9: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {
	String text = response.getText();
	HTML html = new HTML(HtmlSanitizerUtil.sanitizeHtml(text));
	navbarheader.clear();
	navbarheader.add(html);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:InventoryMap.java

示例10: unmarshal

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void unmarshal(Response response) {
  if (response.getText() != null) {
    if (isJsonArray(response)) {
      payload = (T) dtoFactory.createListDtoFromJson(response.getText(), dtoInterface);
    } else {
      payload = (T) dtoFactory.createDtoFromJson(response.getText(), dtoInterface);
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:DtoUnmarshaller.java

示例11: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
public void onResponseReceived(Request request, Response response) {
  String responseText = response.getText();
  try {
    JSONValue jsonValue = JSONParser.parse(responseText);
    displayJSONObject(jsonValue);
  } catch (JSONException e) {
    displayParseError(responseText);
  }
  resetSearchButtonCaption();
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:11,代码来源:JSON.java

示例12: unmarshal

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void unmarshal(Response response) {
  builder = response.getText();
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:StringUnmarshaller.java

示例13: translate

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
public static List<KscReport> translate(final Response response) {
    final String jsonText = response.getText();
    return translate(jsonText);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:5,代码来源:KscReportRestResponseMapper.java

示例14: onResponseReceived

import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {
	
	String text = response.getText();
	setAnnotations(text);
	
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:LASAnnotationsButton.java


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