form表格提交,其中对象中有list集合

domain


public class HouseManager {
	 
	/**
	 * 主键id(自增主键)
	 */						
	private Integer managerId;					
	//HouseManager 其他属性 省略
	/**
	 * 子项list
	 */
	private List equipInformationList;

	public List getEquipInformationList() {
		return equipInformationList;
	}

	public void setEquipInformationList(List equipInformationList) {
		this.equipInformationList = equipInformationList;
	}

}

public class HouseEquipInformation extends BaseEntity{
	 
	/**
	 * 主键id(自增主键)
	 */						
	private Integer inforId;					
	// 属性 get set方法省略

}

Controller层

	@RequestMapping("insertHouseManager")
	@ResponseBody
	public Map insertHouseManager(HouseManager houseManager){
		Map map = Maps.newHashMap();
		try {
			houseManagerService.insertHouseManager(houseManager);
			map.put(Constants.MSG, "添加成功");
			map.put(Constants.SUCCESS, true);
		} catch (Exception e) {
			e.printStackTrace();
			map.put(Constants.SUCCESS, false);
			map.put(Constants.MSG, "系统异常,请重试");
		}
        return map;
	}

js代码

Preservation: function(){
	  	var formData = $('#addForm').serializeObject();
      var equitNodes = $(".l_conadd .l_add_part"); // list内容块
      for(var i=0;i

你可能感兴趣的:(java)