Struts2 如何从jsp获取arrayList中的数据

Struts2 如何从jsp获取arrayList中的数据,struts2,Struts2,这是我的jsp表单 <form action="submit"> <tr class="row" id="item1"> <td><input type="text" name="type" class="type" style="width: 50px"/></td> <td><input type="text" name="color" class="color" style="width: 50px

这是我的jsp表单

<form action="submit">
  <tr class="row" id="item1">
  <td><input type="text" name="type" class="type"  style="width: 50px"/></td>
  <td><input type="text" name="color" class="color" style="width: 50px"/></td>
  <td><input type="text" name="qty" class="qty" style="width: 50px"/></td>
  <td><input type="text" name="unitprice"   class="unitPrice" style="width: 50px"/></td>
 </tr>

...
 <tr class="row" id="itemN">
  <td><input type="text" name="type" class="type"  style="width: 50px"/></td>
  <td><input type="text" name="color" class="color" style="width: 50px"/></td>
  <td><input type="text" name="qty" class="qty" style="width: 50px"/></td>
  <td><input type="text" name="unitprice"   class="unitPrice" style="width: 50px"/></td>
 </tr>

</form>

...
我想获取可能包含1到N个项目的数据,每个项目包含
类型
颜色
数量
单价
。我想将所有这些数据存储在ArrayList变量中。

如何执行此操作?

您需要的是

通常XWork类型转换正在执行此操作。XWork显示导入错误
导入com.atlassian.confluence.core.ConfluenceActionSupport
;不理解,不理解你不理解的任何其他例子。您基本上必须在bean上进行迭代。例如,如果你有一个bean(让我们把它命名为产品),属性是type color qty和unitprice。因此,您不需要设置单独的属性,而是创建产品bean的列表,然后迭代该列表,并使用点表示法在JSP中设置值。e、 g
我只需要从jsp tp arraylist中获取值