后台list数据保存request中,前台取出遍历

一、后台: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" />
      &nbsp;&nbsp;-处理情况:【<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>  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值