舉例說明:
【后台有一個對象 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>
========================================分割線
