spring 前后台传参错误!

var node = $("#basicShow").children("tbody").children("tr");

    var fundAgencys = new Array();
    $("#basicShow").children("tbody").children("tr").each(function(i){  
        velocityNum=i+1;
        var fundAgency = new Object();
        fundAgency.serialno = node.eq(i).children("td:last-child").children("#serialno"+velocityNum).text();
        fundAgency.updatedatetime = node.eq(i).children("td:last-child").children("#updatedatetime"+velocityNum).text();
        fundAgencys.push(fundAgency);
    })  
    var array = {"fundAgencies":fundAgencys};
    var data = $.extend(Horn.getComp("searchForm3").getValues(),array);

我前台传入值
图片描述
后台得值的类型
Model{

string classifyid;
string fundcode;
List<A> fundAgencies;

}
A{

string serialno;
string updatedatetime;

}
但是我后台报了这些错 哪有问题吗,该怎么改?

org.springframework.beans.InvalidPropertyException: Invalid property 'fundAgencies[0][serialno]' of bean class [...Model]: Property referenced in indexed property path 'fundAgencies[0][serialno]' is neither an array nor a List nor a Map; returned value was [1000003142]
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1006)
阅读 7.7k
4 个回答

属性类型不匹配,你传了个 array,后台接收的不是 array 或则 list

是否需要转成json串

新手上路,请多包涵

'fundAgencies0' is neither an array nor a List nor a Map;
从日志里看是不是javaBean里面serialno的类型不对?

新手上路,请多包涵

我也遇到这个问题了,不知道原因,后来用 Map 替换 JavaBeanA,然后后台就收到了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题