一、后台:request.setAttribute("stepList", stepList);
前台:使用struts2标签库遍历
<%@ taglib uri="/struts-tags" prefix="s"%>
<td colspan="3"><br />
<s:iterator value="#request.stepList" var="step" status="nws">
<s:property value="%{#nws.index+1}" />.-
<s:property value="#step.staffnum" />-
<s:property value="#step.staffname" />-处理时间:
<s:date name="#step.handtime" format="yyyy-MM-dd HH:mm:ss" />
-处理情况:【<s:property value="#step.vstatus" />】<br />
</s:iterator>
</td>
二、后台:request.setAttribute("list", list2);
前台:用<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 标签遍历
<c:forEach items="${list}" var="user" varStatus="vs">
<tr>
<td class="testLeft">
<input type="text" name="ptype${user.ptype}" id="ptype" style="width:30px" value="${user.ptype}" />
</td>
<td class="testLeft">
<input type="text" name="pname${user.ptype}" id="pname${user.ptype}" style="width:30px" value="${user.pname}" />
</td>
<td class="testLeft">
<c:if test="${user.pstatus == 1}">
<select id="pstatus" name="pstatus${user.ptype}" selwidth="60" class="pcls" selectedvalue="1" truetype="select" length="10" reltext="有效" relvalue="1" finished="true" style="width:50px;height:20.1px">
<option value="1">有效</option>
<option value="2">禁用</option>
</select>
</c:if>
<c:if test="${user.pstatus == 2}">
<select id="pstatus" name="pstatus${user.ptype}" selwidth="60" class="pcls" selectedvalue="2" truetype="select" length="10" reltext="禁用" relvalue="2" finished="true" style="width:50px;height:20.1px">
<option value="2">禁用</option>
<option value="1">有效</option>
</select>
</c:if>
</td>
<td class="testLeft">
<span class="img_delete" οnclick="ondelPri(this)" style="width:30px;background-repeat: no-repeat;height: 15px;background-image: url(../../comm/easyUI/themes/icons/cancel.png);display: inline-block;"></span>
</td>
</tr>
</c:forEach>