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;
}
....
求大神解答
伊谢尔伦2017-04-17 17:57:09
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
阿神2017-04-17 17:57:09
Post json on the front end, and just use @RequestBody as the backend controller parameter
伊谢尔伦2017-04-17 17:57:09
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