Organizational Research By

Surprising Reserch Topic questions - Question:Sending list in JSON request

I am sending few 'fields' and 'lists' in JSON to Spring MVC Controller as below:

    var data = {
        'message' : 'Text data',
        '**listOfIds**' : '350234983, 378350950',

        'synchronizerToken' : formTokenId


        url : '',
        type : 'post',
        data : data,
        cache : false,
        dataType : 'json',

        success : function (jsonResponse) {},

        error : function (error) {}

In Spring MVC controller the URL handler looks like this:

    @RequestMapping(value = "/", method = RequestMethod.POST)
public ModelAndView executeTest( ListData listData) {
        ModelAndView    modelAndView    = null;
        JsonResponse    jsonResponse    = null;

        modelAndView    = executeTransaction(listData);

        return modelAndView;

public class ListData{
    private String          message;
    private List    **listOfIds** = new ArrayList();   


The issue is listOfIds is not being returned as list. It is returned as single string '350234983, 378350950'

Can anyone suggest if anything is wrong here or is there any better way to receive list in JSON response?

asked Sep 13, 2013 in Core java by anonymous
edited Sep 12, 2013
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.