java - springmvc 数据绑定时,如何自动接受复合对象?
大家讲道理
大家讲道理 2017-04-17 17:55:09
0
3
324

springmvc 数据绑定时,如何自动接受复合对象(已封装Bean)

如:
Bean{

map<Long,List<T>> map;

}
Bean{

map<Object,List<T>> map;

}

Bean{

map<Long,map<Integer,Integer>> map;

}

Bean{

map<Long,map<Integer,List<T>>> map;

}

....
求大神解答

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
伊谢尔伦

It is not possible to directly specify the parameter as Map in the Controller. You need to encapsulate a Bean to receive the data. You can watch this video: http://www.imooc.com/learn/558

阿神

Post json on the front end, and just use @RequestBody as the backend controller parameter

伊谢尔伦

Post json from the front end, and just use @RequestBody as the backend controller parameter.
I agree with the answer above. Use post request and @RequestBody will automatically parse it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template