suchen

Heim  >  Fragen und Antworten  >  Hauptteil

java - springmvc 数据绑定时,如何自动接受复合对象?

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;

}

....
求大神解答

大家讲道理大家讲道理2893 Tage vor339

Antworte allen(3)Ich werde antworten

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:57:09

    在Controller里直接指定参数为Map是不行的,需要封装一个Bean来接收数据。可以看下这个视频:http://www.imooc.com/learn/558

    Antwort
    0
  • 阿神

    阿神2017-04-17 17:57:09

    前端post json过来,后端controller参数@RequestBody就可以了

    Antwort
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:57:09

    前端post json过来,后端controller参数@RequestBody就可以了。
    同意楼上的回答,是用post请求,@RequestBody会自动解析的

    Antwort
    0
  • StornierenAntwort