RestyGWT基于JSON的REST框架
RestyGWT是一個(gè)REST服務(wù)GWT生成器和Java Object與JSON數(shù)據(jù)格式轉(zhuǎn)換引擎。它能夠生成基于JSON的異步Restful服務(wù)代理,提供易于使用的REST API。
示例代碼:
Resource resource = new Resource( GWT.getModuleBaseURL() + "pizza-service");
JSONValue request = ...
resource.post().json(request).send(new JsonCallback() {
public void onSuccess(Method method, JSONValue response) {
System.out.println(response);
}
public void onFailure(Method method, Throwable exception) {
Window.alert("Error: "+exception);
}
});評(píng)論
圖片
表情
