如何将JSonArray发送到spring控制器

时间:2018-12-25 11:45:30

标签: json ajax spring

我如何通过Ajax调用将jsonArray发布到spring控制器?

[{"REQUEST_ID":"BBBBBBB","MATCH_COUNT":"Accountant","CLIENT_ID":"Tokyo","MATCH_REASON":"63","NAME":"2011/07/25","FATHER_NAME":"$170,750"},{"REQUEST_ID":"CCCCCCC","MATCH_COUNT":"Junior Technical Author","CLIENT_ID":"San Francisco","MATCH_REASON":"66","NAME":"2009/01/12","FATHER_NAME":"$86,000"}]

这是我的JSON数组,希望通过它!

$.ajax({
            type : "POST",
            dataType: 'json',

            contentType:'application/json',

            url : "getCheckBoxData",
            data : JSON.stringify(jsonData),
        //  data : "data="+JSON.stringify(data),
            //async : false,
            success : function(response) {

@RequestMapping(value = "/getCheckBoxData", method = RequestMethod.POST)
public String checkBoxData(@RequestBody List<ListOfCheckBox> value, HttpSession session

1 个答案:

答案 0 :(得分:0)

您要发送的数据应与控制器功能中的参数类型匹配。您要面对什么确切的问题?