views:

349

answers:

1

The following code

 RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode("http://localhost:8080/xxxx/yyyy"));

try {
       Request request = builder.sendRequest(null, new RequestCallback() {
         public void onError(Request request, Throwable exception) {
         }

         public void onResponseReceived(Request request, Response response) {
         }

       });
     } catch (RequestException e) {
       possiblePages.clear(); possiblePages.addItem("could not connect to server");        
     }

Written in GWT/Java compiles to javascript that gives the following error (shown in firebug)

syntax error
[Break on this error] begin

"begin" is the first line of the text file that is returned from the url, so I see where it is getting it from, but why is it being treated as JavaScript?

+1  A: 

Hey Matt, I have 2 ideas that you can try:

  1. Try explicitly setting the response's content type to "text/html" or "text/xml" in your servlet and see if that helps.
  2. Try clearing firefox's cache? I've seen a few rare cases where old gwt javascript gets cached and conflicts with new code.
Dave Paroulek
you were right with 1. Thanks.
Matt Roberts