在form中提交list

1. form把对应的entity如下,

public class DailyReport extends DataEntity {
    private  Integer dailyReportId;
    private User user;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date dailyDate;
    private Date createDate;
    private Date updateDate;
    private List dailyReportDetailList;
    private String isPublish;
2. 页面

class="dailyReportDetailItem">
class="control-group">
class="controls">
3. 定义要提交的List,的entity. 

public class DailyReportDetailList {
    private List dailyReportDetails;

    public List getDailyReportDetails() {
        return dailyReportDetails;
    }

    public void setDailyReportDetails(List dailyReportDetails) {
        this.dailyReportDetails = dailyReportDetails;
    }

    public DailyReportDetailList(List dailyReportDetails){
    super();
    this.dailyReportDetails = dailyReportDetails;
    }
    public DailyReportDetailList(){
        super();
    }
}

你可能感兴趣的:(杂)