举例说明:

 【后台有一个对象 User    一个PhotoDo对象】,结构如下:

 public class User{

 private String username;

  private List<PhotoDo> photo;

  ..get ....set.....

 }

public class PhotoDo{

 private String id;

 private String name;

  ...get...set...

}

【Controller中接受方法 getUser】

@reqeustMapping("/getUser")

public void getUser(User user){

...实现方法...

}

【前台Form这么写:】

<form>

     <input type="text" name="username" aciton="..">

     <input type="text" name="photo[0].id">

     <input type="text" name="photo[0].name">

     <input type="text" name="photo[1].id">

     <input type="text" name="photo[1].name">

     <input type="text" name="photo[2].id">

     <input type="text" name="photo[2].name">

</form>

 

========================================分割线

 

相关文章:

  • 2021-11-24
  • 2021-12-30
  • 2021-12-26
  • 2022-12-23
  • 2021-12-26
  • 2022-03-09
  • 2021-12-09
猜你喜欢
  • 2021-06-24
  • 2021-09-08
  • 2022-12-23
  • 2021-12-26
  • 2021-11-27
相关资源
相似解决方案