public List<FormulaDetail> formulaDetails; public List<FormulaDetail> getFormulaDetails() { return formulaDetails; } public void setFormulaDetails(List<FormulaDetail> formulaDetails) { this.formulaDetails = formulaDetails; }
JSP傳過來的數組formulaDetails[0].count不能被struts2接收,通過查詢發現是FormulaDetail類沒有缺省的構造函數數組
public FormulaDetail() { }
只有一個帶參數的函數函數
/** full constructor */ public FormulaDetail(Integer formulaId, Integer goodsCategory, Integer percent) { this.formulaId = formulaId; this.goodsCategory = goodsCategory; this.percent = percent; }
講缺省構造函數添加以後,成功接收數組參數this