SpringMVC AJAX pass array problem

I encountered a problem today, the front-end AJAX transfer array cannot be received by the back-end interface.

The beginning of ajax is written like this

$.ajax({
            type:'POST',
            url:'${ctx}/scheduleStudentScoreController/exportScore',
            data:{
                'ids':scoreIds
            },
            success:function(result){
                console.log(result);
            },
            error:function(result){
                console.log(result);
            }
        })

I found it online and found that ajax has an attribute

traditional。

This property is defined like this:

Therefore, we can write ajax like this:

$.ajax({
            type:'POST',
            url:'${ctx}/scheduleStudentScoreController/exportScore',
            data:{
                'ids':scoreIds
            },
            traditional: true,
            success:function(result){
                console.log(result);
            },
            error:function(result){
                console.log(result);
            }
        })

Related Links

http://folyred.iteye.com/blog/1554825

http://www.jb51.net/article/113586.htm

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325935127&siteId=291194637