1.在Action中定義,List<Product>屬性(Product爲pojo)
2.jsp頁面中:
<s:iterator value="new int[3]" status="stat">
<tr>
<td><s:textfield name="%{'productList['+#stat.index+'].name'}"/></td>
<td><s:textfield name="%{'productList['+#stat.index+'].price'}"/></td>
<td><s:textfield name="%{'productList['+#stat.index+'].dateOfProduction'}"/></td>
</tr>
</s:iterator>
其中productList爲Action的List屬性名,name,price,dateOfProduction爲Product的屬性
3.定義屬性文件(與Action同一目錄),Action名稱-converstion.properties,格式爲:Element_屬性名=Product