Monday, January 31, 2011

RequestBuilder response status code is 0?!

I have created servlet which returns just a string. It works typing in
browser servlet url.
But when I try to get it using RequestBulder i get response status
code 0! Please help!

url = http://localhost:8888/redirect.htm

public void requestProductsFromStock(String url){
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,

try {
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(asArrayOfProducts(response.getText()));
} else {
displayError("Couldn't retrieve JSON (" +
+ ")");
} catch (RequestException e) {
displayError("Couldn't retrieve JSON");
}catch(Exception e){

servlet code is

PrintWriter out = res.getWriter();

Why am I getting this stupid error code?! I tried in Chrome and

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment