jquery ajax传递数组,list

JQuery 传递数组,List
参考:https://blog.csdn.net/yufeiyanliu/article/details/53738583

springMvc接受数组,List 参数报错:

Request processing failed; nested exception is java.lang.NumberFormatException: For input string: “”

解决方案

ajax中设置 “ traditional: true, ”

$.ajax{ 
    url:"/xxxx/.../", 
    traditional: true, 
    data:{ 
        fieldName: ["it1", "it2", "it3"] 
    } 
    ...... 
}

你可能感兴趣的:(javascript)