Property referenced in indexed property path is neither an array nor a List nor a Map


記一次傳參請求報錯,沒有解決

Invalid property 'distributeCars[0][ackStatus]' of bean class [com.api6.plate.prototype.dailyoffice.car.entity.ApprovalForCar]: Property referenced in indexed property path 'distributeCars[0][ackStatus]' is neither an array nor a List nor a Map; returned value was [com.api6.plate.prototype.dailyoffice.car.entity.DistributeCar@11;id=null]

$.ajax({
url: "${pageContext.request.contextPath}/app/carmange/saveSupplemental",
data: $form.serialize()+'&'+JSON.stringify($.param(data)),//獲得表單數據
dataType:'json',
success: function(m){

 復雜傳值list 如果是distributeCars[0].ackStatus,就可以。

 

 

JavaScript模擬表單(帶數組的復雜數據結構)提交
function test(){
    var typeArray = new Array();
    typeArray.push("mm");
    typeArray.push("gg");
    
    var demoarry = new  Array();
    demoarry.push("dd");
    demoarry.push("qq");
    
    typeArray.push(demoarry);
    
    console.log(typeArray);
    
    var id = 0;
    var data = {
        id:  id ,
        type: typeArray,
        demoarry : demoarry
    };
    httpPostUrlExt("http://www.baidu.com",data);
}

function httpPostUrlExt(url, data) {
    var temp = document.createElement("form");
    temp.action = url;
    temp.method = "post";
    temp.style.display = "none";
    for (var x in data) {
        if(Object.prototype.toString.call(data[x]) === '[object Array]' ) {
            var arr = data[x];
            while(arr.length){
                var opt = document.createElement("textarea");
                opt.name = x;
                opt.value = arr.pop();
                temp.appendChild(opt);
            }
        } else {
            var opt = document.createElement("textarea");
            opt.name = x;
            opt.value = data[x];
            temp.appendChild(opt);
        }
    }
    document.body.appendChild(temp);
    console.log(temp);
    //temp.submit();
    return temp;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM