google-code-export / rocket-gwt

Automatically exported from code.google.com/p/rocket-gwt
1 stars 1 forks source link

Numbers entered aginst a String literal are not parsed back from Json #67

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Assume you have a java object with a property of type String
2. Enter only number for the property and convert the object to Json
3. Convert the Json message back to java object

What is the expected output? What do you see instead?
property of type String should hold the number data as a String 

What version of the product are you using? On what operating system?
Rocket 0.56 on Windows XP professional

Please provide any additional information below.
We are using Json as the medium of communication between GWT(GXT) client and 
RESTFul services. Both client side and server side we are using Java DTOs. So 
DTOs<=>Json conversion happens on every request.

Original issue reported on code.google.com by Sudheer....@gmail.com on 19 Jul 2010 at 11:19

GoogleCodeExporter commented 9 years ago
If i remember correctly have you attempted a simple sample using GWT JSONObject 
and its accompanying sub classes ?

Original comment by miroslav...@gmail.com on 25 Jul 2010 at 11:13

GoogleCodeExporter commented 9 years ago
We are using JSONParser, JSONValue and JSONObject of GWT while parsing the 
message from response.getText(). Here response is of type 
com.google.gwt.http.client.Response.

Original comment by Sudheer....@gmail.com on 26 Jul 2010 at 4:31

GoogleCodeExporter commented 9 years ago
One another question

Are you planning to support latest version of gwt 2.1.x? When we compiled with 
latest gwt version, we got compilation errors about JsonSerializer. As the 
forum is not active and we do not have much of the implementation knowledge, we 
are planning to replace rocket with our own implementation.

Original comment by Sudheer....@gmail.com on 26 Jul 2010 at 4:37

GoogleCodeExporter commented 9 years ago
You havent confirmed the result of the writing then parsing back using GWT 
JSONvalue with your own code.. basically trying to create a small reproducable 
demonstration of jsonparsing/writing using JSONValue et al.

Original comment by miroslav...@gmail.com on 26 Jul 2010 at 6:56

GoogleCodeExporter commented 9 years ago
I did not get you on last comment.
Below is our sample code. 'result' contains the list of objects. 
As you mentioned JSON message it self is not having "" around the number that 
is placed within a string. 

JSONValue jsonValue = JSONParser.parse(response.getText());                
log.info("JSON : "+jsonValue.toString());
JSONObject jsonUIResponseObj = 
jsonValue.isObject().get("UIServiceResponse").isObject();                
JSONValue jsonPageConfigValue = jsonUIResponseObj.get("pageConfig");
if (jsonPageConfigValue != null){
.........
}

JSONValue jsonResultValue = jsonUIResponseObj.get("result");                

Original comment by Sudheer....@gmail.com on 27 Jul 2010 at 4:35

GoogleCodeExporter commented 9 years ago
Can you confirm that JSONValue itself is failing to handle the "String" 
property type. You might also want to add "-gen <temp-dir>" and examine the 
generated *.java and verify the right thing is happening when it deserializes 
the problme property...

Original comment by miroslav...@gmail.com on 28 Jul 2010 at 12:42