How to read json with mulitple array in spring mvc controller?
<p>I am sending json from ajax to controller that contain multiple array.</p>

<p>Json Data: </p>

<pre><code>{
    "node": [
        {
            "id": "dev_1",
            "blockId": "11"
        },
        {
            "id": "dev_2",
            "blockId": "15"
        }
    ],
    "connect": [
        {
            "id": "con_5",
            "typeId": "2"
        }
    ],
    "name": "test"
}
</code></pre>

<p>Controller:</p>

<pre><code>@RequestMapping(value = "/saveBoard", method = RequestMethod.POST)
    public JsonResponse saveBoard(@RequestBody String jsonData) throws IOException {
        JsonResponse response = new JsonResponse();
        ObjectMapper mapper = new ObjectMapper();
        final JsonNode jsonNode = mapper.readTree(jsonData).get("node");

        if(jsonNode.isArray()) {
            for (final JsonNode nodes : jsonNode) {
                System.out.println("jsonNode : "+ nodes);
            }
        }
        return response;
    }
</code></pre>

<p>I have tried with object mapper but not succeed. 
Here i want to read different array for different classes like node for node class with some specified fields, connect for connect class and string for another use.</p>

<p><strong>UPDATE</strong>
Contorller:</p>

<pre><code>@RequestMapping(value = "/saveBoard", method = RequestMethod.POST)
    public JsonResponse saveMissionBoard(@RequestBody MissionJsonPojo chartJson) {
        boolean status = false;
        String messsage = "";
        JsonResponse response = new JsonResponse();
        System.out.println("data : " + flowChartJson.getNodes());        
        return response;
    }
</code></pre>

<p>Ajax: </p>

<pre><code> $.ajax({
          url: '&lt;c:url value="/board/saveBoard"/&gt;',
          type: 'POST',
          data: JSON.stringify(chartJson),
          dataType: "json",
          contentType: "application/json",
          success: function(response) {
            console.log("In success");
          },
          error: function (a, b, c) {  }
        });
</code></pre>

<p>JSON:</p>

<pre><code>{
    "nodes": [
        {
            "missionDeviceId": "device_1",
            "device": "1",
            "deviceXCoordinate": 79,
            "deviceYCoordinate": 73,
            "blockId": "1##1"
        },
        {
            "missionDeviceId": "device_2",
            "device": "3",
            "deviceXCoordinate": 340,
            "deviceYCoordinate": 146,
            "blockId": "2##5"
        }
    ],
    "connections": [
        {
            "missionConnectionId": "con_5",
            "sourceId": "device_1",
            "targetId": "device_2",
            "device": "2"
        }
    ],
    "name": "test"
}
</code></pre>

<p>Node Pojo:</p>

<pre><code>public class Nodes{
    private String missionDeviceId;
    private Integer device;
    private String deviceXCoordinate;
    private String deviceYCoordinate;
    private String blockId; //getters setters
}
</code></pre>

<p>Connection Pojo:</p>

<pre><code>public class Connections{    
    private String missionConnectionId;
    private String sourceId;
    private String targetId;
    private Integer device; //getters and setters
}
</code></pre>

<p>MissionJsonPojo:</p>

<pre><code>public class MissionJsonPojo{
    private List&lt;Nodes&gt; nodes;
    private List&lt;Connections&gt; connections;
    private String name; //getters and setters
}
</code></pre>