本文整理汇总了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();
}
示例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());
}
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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();
}
示例12: unmarshal
import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void unmarshal(Response response) {
builder = response.getText();
}
示例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);
}
示例14: onResponseReceived
import com.google.gwt.http.client.Response; //导入方法依赖的package包/类
@Override
public void onResponseReceived(Request request, Response response) {
String text = response.getText();
setAnnotations(text);
}