异常 Failed to instantiate [java.util.List]: Specified class is an interface

经ajax请求时出现异常 Failed to instantiate [java.util.List]: Specified class is an interface
代码如图javascript

$(document).ready(function () {
                    
                    $("#frm").validate({
                        rules: {
                        ids: {
                          required: true,
                          minlength: 1,
                          maxlength: 30
                          }
                        },
                        messages: {},
                        submitHandler:function(form){
                            $.ajax({
                               type: "POST",
                               dataType: "json",
                               url: "/admin/project/add/manager",
                               data: $(form).serialize(),
                               success: function(msg){
                                    layer.msg(msg.msg, {time: 2000},function(){
                                        var index = parent.layer.getFrameIndex(window.name); //先获得当前iframe层的索引
                                        parent.layer.close(index);
                                    });
                               }
                            });
                        }
                });
        });
public void add(List<Integer> ids){
   

}

经排查以后,发现不能自动转化为接口。因而建立一个vo,包装需传递的参数,代码以下java

package com.susoft.vo;

import java.util.List;

public class ManagerIdVo {

     private List<Integer> ids;

    public List<Integer> getIds() {
        return Ids;
    }

    public void setIds(List<Integer> Ids) {
        this.Ids = Ids;
    }

      
}
public void add(ManagerIdVo managerIdVo){

}

页面能够成功跳转了ajax

相关文章
相关标签/搜索