Created
May 18, 2013 05:42
-
-
Save ochilab/5603372 to your computer and use it in GitHub Desktop.
GWTにてGWT-RPCのクライアントサイドでの呼び出し処理のサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XXXXServiceAsync service = GWT.create(XXXXService.class); | |
//RPC処理 | |
service.xxxx("", new AsyncCallback<String>() { //XXXXのところは変更 | |
public void onSuccess(String result) { | |
// RPC呼び出しが成功したときの処理 | |
} | |
public void onFailure(Throwable caught) { | |
//RPC呼び出しが失敗したときの処理 | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最初の行の serviceインスタンスの生成は1度でOKです。なんども作り直す必要はありません。次の行は、リモートの関数XXXを実行している意味になります。第2引数でコールバック時の処理を含めて定義しています(無名クラスを記述しているといいます)。