My favorites
▼
|
Sign in
synthfuljava
Synthful Utilities Library for the Java Platform.
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
gwt
/
http
/
org
/
synthful
/
gwt
/
http
/
client
/
JsonHttpResponseHandler.java
r105
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package org.synthful.gwt.http.client;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONException;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
abstract public class JsonHttpResponseHandler
extends HttpResponseHandler
{
public JsonHttpResponseHandler(String url)
{
super(url);
}
public void onResponse(
Request request, Response response)
{
try
{
// parse the response text into JSON
JSONValue jsonValue = JSONParser.parse(response.getText());
JSONObject jsonObj = jsonValue.isObject();
if (jsonObj != null)
{
JsonData = jsonObj;
this.Status = HttpResponseStatus.Normal;
this.onJsonResponse(this);
}
else
{
this.Status = HttpResponseStatus.EmptyData;
throw new JSONException();
}
}
catch (JSONException e)
{
this.Status = HttpResponseStatus.DataParseFailure;
}
}
public JSONObject JsonData;
abstract protected void onJsonResponse(
JsonHttpResponseHandler jsonHttpResponseHandler);
}
Show details
Hide details
Change log
r82
by BlessedGeek on Jun 30, 2010
Diff
[No log message]
Go to:
...nts/org/synthful/gwt/domElements
...g/synthful/gwt/http/HTTP.gwt.xml
...ent/JsonHttpResponseHandler.java
/trunk/gwt/jsObjects
/trunk/gwt/json
/trunk/gwt/mvp
/trunk/gwt/mvp/org
/trunk/gwt/mvp/org/synthful
/trunk/gwt/mvp/org/synthful/gwt
/trunk/gwt/mvp/org/synthful/gwt/mvp
...org/synthful/gwt/mvp/MVP.gwt.xml
.../mvp/org/synthful/gwt/mvp/client
...t/mvp/client/JsonDataSource.java
...vp/client/PresentableEntity.java
...p/client/PresentationEntity.java
.../mvp/org/synthful/gwt/mvp/server
...nthful/gwt/mvp/server/UIMap.java
...ful/gwt/mvp/server/UISchema.java
/trunk/gwt/patched-user
/trunk/gwt/smartgwt
...client/ui/ScrolledDialogBox.java
...s/client/fields/FieldEntity.java
...gets/client/fields/FieldSet.java
...t/fields/FieldSetDescriptor.java
...nk/gwt/widgets/org/synthful/util
...nthful/util/HashMapTreeNode.java
.../synthful/util/HashTreeNode.java
.../synthful/util/TreeLeafNode.java
.../org/synthful/util/TreeNode.java
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1421 bytes, 49 lines
View raw file
Powered by
Google Project Hosting