Hi,
for a YUI 3 Plugin i need the following data structure to be returned by the
backend:
[
{
"dateline": 1269141246,
"content": "There are two cows",
"link": "#cows"
},
{
"dateline": 1269141246,
"content": "There are two pigs",
"link": "#pigs"
}
]
So basically an array structure without name.
When i create the JSON output with a simple Struts 2 Action:
public class JsonNotificationsAction {
private List<NotificationStruct> result = new
ArrayList<NotificationStruct>();
public String execute() {
// fill the list
return Action.SUCCESS;
}
public class NotificationStruct {
long dateline;
String content;
String link;
....
}
}
Now this action results in the following output:
{"result":[{"content":"blabla
balabla","dateline":1270241423080,"link":"#foo"},{"content":"blabla
balabla","dateline":1270241423080,"link":"#foo"}]}
It nearly matches what is expected but how can i get rid of the parent
"result". It seems its not possible at all but this would mean i cant use
Struts2 for getting the output outlined above
Thanks for hints.....
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]