Share Coding

Tutorials, Problems, Stuffs …

Tag Archives: rpc

Cross Domain Request on GWT without RPC

Since RequestBuilder do not support cross domain on GWT, the other option will be JsonpRequestBuilder
Here is an example between client and server (PHP).

 
Client.java

JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
jsonp.requestObject(URL.encode("http://serverurl/Server.php?callback=test_clbk"), new AsyncCallback() {
	public void onFailure(Throwable throwable) {
		System.out.println(throwable.getMessage());
	}
	public void onSuccess(JSONreceiver result) {
		System.out.println(result.getResult());
	}
});

 
Read more of this post

Advertisements