先贴两个实体类的代码
ObjectInnerParam.java (省略set和get方法)
public classObjectInnerParam {
privateStringp1;
privateStringp2;
}
ObjectParam.java(省略set和get方法)
public classObjectParam {
privateStringp1;
privateStringp2;
privateListlist;
privateObjectInnerParaminnerParam;
privateMapmap;
}
Controller的代码,每种传值方法详见注释:
总结:List和Map是无法作为参数接收传值的,只能通过对象进行,如果一定要使用map或list,可将list或map作为一个对象的属性,使用这个对象作为参数来接收传值。以上均为本人亲测,如有异议,欢迎讨论,本人微信:(执行以下JS代码可查看本人微信 -_-)
var arr = ['7','0','y','n','i','g','b','o','u'],indexArr = [2,8,3,4,3,5,6,7,1,1,0],result = [];
for(var i=0,j=indexArr.length;i<j;i++){result.push(arr[indexArr[i]]);}
console.info(result.join(''));