I have a controller function that returns a list datatype that gets converted to JSON once sent back to my jQuery.
My problem (well not really a problem) is that the data return has no field names and I would prefer them to have the field names.
I found some post here that involves configuring jackson but it seems it's a global setting. I only want some functions to return named fields.
Can you please help? thanks
my controller function
@RequestMapping(value = "/GetEvents", method = RequestMethod.GET, headers="Accept=*/*")
public @ResponseBody List<Session> getEvents(@RequestParam("description") String description) {
List<Session> temp = issuService.getEvents(description);
return temp;
}
data return by function (as viewed in firebug)
[[1149,"Thursday , 31 January 2013 @ 13:00 - 15:00",1,"2013-01-31"],[1150,"Wednesday, 06 February 2013 @ 13:00 - 15:00",1,"2013-02-06"],[1151,"Wednesday, 13 February 2013 @ 13:00 - 15:00",1,"2013-02-13"],[1152,"Monday , 18 February 2013 @ 13:00 - 15:00",1,"2013-02-18"],[1169,"Wednesday, 20 February 2013 @ 13:00 - 15:00",1,"2013-02-20"],[1170,"Monday , 25 February 2013 @ 13:00 - 15:00",1,"2013-02-25"],[1171,"Tuesday , 26 February 2013 @ 13:00 - 15:00",1,"2013-02-26"],[1172,"Wednesday, 27 February 2013 @ 13:00 - 15:00",1,"2013-02-27"],[1173,"Thursday , 28 February 2013 @ 13:00 - 15:00",1,"2013-02-28"],[1174,"Friday , 01 March 2013 @ 13:00 - 15:00",1,"2013-03-01"]]