0
这是我的Java类。 processOrderMap
是一个ArrayList
与HashMap
类型。此列表使用jsp
中的迭代器进行迭代。我想在表单提交时在java类中获得迭代列表。我用如何通过Struts 2中的表单提交获取迭代器列表
"processOrderMap[%{#ctr.index}].processPositionGrid"
上面的代码作为选择框名称,但它不工作。
public String addProcessOrderGridDetails() {
try {
HashMap hmap = new HashMap();//desc,suppartno,qnty,total
hmap.put("routeIdGrid", routeId);
hmap.put("routeNoGrid", routeNo);
hmap.put("routeDescGrid", routeDesc);
hmap.put("routeListGrid", routeGridList);
hmap.put("processPositionGrid", processPositionList);
processOrderMap.add(hmap);
} catch (Exception e) {
System.out.println("Exception in addProcessOrderGridDetails Method of productionRouteAction" + e);
}
return SUCCESS;
}
这是我的jsp页面...
<s:iterator value="processOrderMap" status="ctr">
<tr>
<td style="" class="">
<s:property value="#ctr.count"/>
</td>
<td style="" class=""> <s:hidden theme="simple"
id="%{'routeNoGrid' + #ctr.index}"
name="processOrderMap[%{#ctr.index}].routeNoGrid"
value="%{routeNoGrid}"/>
<s:hidden theme="simple" id="%{'routeIdGrid' + #ctr.index}"
name="processOrderMap[%{#ctr.index}].routeIdGrid"
value="%{routeIdGrid}"/>
<s:property value="routeNoGrid"/>
</td>
<td style="">
<s:select theme="simple" data-rel="chosen"
id="%{'processPositionGrid' + #ctr.index}"
name="processOrderMap[%{#ctr.index}].processPositionGrid"
list="processPositionGrid"
listKey="id" listValue="name"
headerKey="0" headerValue="--SELECT--"
cssClass="required input-medium selectMap" />
</td>
<td>
<s:select theme="simple" data-rel="chosen" id="%{'routeListGrid' + #ctr.index}"
name="processOrderMap[%{#ctr.index}].routeListGrid" list="routeListGrid"
listKey="id" listValue="name" multiple="true"
headerKey="0" headerValue="--SELECT--"
cssClass="required" />
</td>
</tr>
</s:iterator>
实际上我想获得java类中的processOrderMap列表 – user3065905
这是在您的代码中看不到的。 –