using RequestBuilder, Request on server side

386 views
Skip to first unread message

Paolo Quadrivium

unread,
May 6, 2011, 11:07:53 AM5/6/11
to Google Web Toolkit
I'm using HttpRequests via RequestBuilder/Request on client side and
everything is OK.
I tried to move this operation on server side and at run-time I get
the following error:

java.lang.UnsatisfiedLinkError:
com.google.gwt.xhr.client.XMLHttpRequest.create()Lcom/google/gwt/xhr/
client/XMLHttpRequest;
I'm using Eclipse.
What is missing?
Thanks in advance.



My code in server is:
String url = "http://localhost:50000";
String data = "Ciao Ciao";
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
url);

try {
Request request = builder.sendRequest(data, new RequestCallback()
{
public void onError(Request request, Throwable exception) {
// Couldn't connect to server (could be timeout, SOP
violation, etc.)
}

@Override
public void onResponseReceived(Request request, Response response)
{
// TODO Auto-generated method stub

}

});
} catch (RequestException e) {
// Couldn't connect to server
}


sal...@gmail.com

unread,
May 11, 2011, 6:22:31 AM5/11/11
to Google Web Toolkit
I'd imagine that the implementation uses the browser for most of this
work (so isn't available on the server)... If you really want to do it
this way you might be able to hack it with htmlunit (like the unit
tests) but you would probably be much better off using a more normal
server side (JVM) approach.
Reply all
Reply to author
Forward
0 new messages