Spring MVC + XStream + JAVA serverside integration

Spring MVC + XStream + JAVA serverside integration

soroushhakamisoroushhakami Posts: 10Questions: 0Answers: 0
edited September 2011 in General
Hello all,

I'm trying to create a JSON-string looking like the 'objects.txt' one that you get with the download package using XStream on the serverside in a Spring MVC-project. My
Currently I'm creating an array of objects, but the formatting does not look exactly the same as the one in objects.txt

Does anyone have experience on doing this, or know of any useful resources?


objects.txt
[code]
{ "aaData": [
{
"engine": "Trident",
"browser": "Internet Explorer 4.0",
"platform": "Win 95+",
"version": "4",
"grade": "X"
},
{
"engine": "Trident",
"browser": "Internet Explorer 5.0",
"platform": "Win 95+",
"version": "5",
"grade": "C"
},
{
"engine": "Trident",
"browser": "Internet Explorer 5.5",
"platform": "Win 95+",
"version": "5.5",
"grade": "A"
},
] }
[/code]

Replies

  • soroushhakamisoroushhakami Posts: 10Questions: 0Answers: 0
    The problem lied in the routing of the controllers - all requests went through a special marshaler that ruined my formatting.

    I circumvented this and then made a new controller using GSON to format my Java-objects into JSON-strings, worked like a charmed.
  • Sy8Sy8 Posts: 2Questions: 0Answers: 0
    Hi Sooushhakami, can you give me an example of what you did? I am trying the same thing with formatting that doesn't fit the aadata...thanks.
This discussion has been closed.