// Send request to server and catch any errors.
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
url);
try {
Request request = builder.sendRequest(null, new
RequestCallback() {
public void onError(Request request, Throwable exception) {
displayError("Couldn't retrieve JSON");
}
public void onResponseReceived(Request request, Response
response) {
if (200 == response.getStatusCode()) {
updateTable(asArrayOfStockData(response.getText()));
} else {
displayError("Couldn't retrieve JSON (" +
response.getStatusText()
+ ")");
}
}
});
} catch (RequestException e) {
displayError("Couldn't retrieve JSON");
}
Where URL is an external server for exemple "http://localhost:8080/
MyApplication/MyExternalServlet
When I recived the request I have the string data, but in the response
in applicatione GWT is always empty.
Why?
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment