jstl+el表达式实现list在jsp页面的输出
发布日期:2022-02-10 13:35:39 浏览次数:23 分类:技术文章

本文共 1173 字,大约阅读时间需要 3 分钟。

pendingView.jsp使用jstl+el表达式,来显示list的集合,显示8条信息,如果记录为空,显示无数据,并有7条数据空行,

action:

UserBean user = new UserBean();

user.setMail("");

user.setCN("lizc");

user.setOU("lizc");

List userList = new ArrayList();

userList.add(user);

request.setAttribute("userList",userList);

 

 

    <c:set var="count" value="0"/>
    <c:forEach var="user" items="${userList}" varStatus="index">
     <tr height="24">
       <td bgcolor="#FFFFFF"><input type="radio" name="userUnique" value="<c:out value="${user.mail}"/>" οnclick="setSelectUserName(this);"/>
             <input type="hidden"  id="<c:out value="${user.mail}"/>"  value="<c:out value="${user.cn}"/>"/>
       </td>
       <td bgcolor="#FFFFFF"><c:out value="${user.cn}"/></td>
       <td bgcolor="#FFFFFF">${user.ou}</td>
     </tr>
     <c:set var="count" value="${index.index + 1}"/>
   </c:forEach>
  
   <c:forEach begin="${count}" end="8">
       <c:if test="${count==0}">
            <tr height="24">
    <td colspan="3" align="center" >
     <DIV style="width:100%;height:100%">
     无满足条件的查询结果
     </DIV>
    </td>
   </tr>
  </c:if>
  <c:if test="${count!=0}">
   <tr height="24">
         <td bgcolor="#FFFFFF">&nbsp;</td>
         <td bgcolor="#FFFFFF">&nbsp;</td>
         <td bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
  </c:if>
  <c:set var="count" value="${count+1}"></c:set>
    </c:forEach>

转载地址:https://blog.csdn.net/zechaolee168/article/details/4391297 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:phper:敢问路在何方
下一篇:IBM was6.1设置jsp 5.0特性

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月16日 16时23分31秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

【深度学习笔记】用torch.nn.ModuleList搭建神经网络 2019-04-30
【解决错误】AttributeError: module ‘scipy.misc‘ has no attribute ‘imread‘ 2019-04-30
【解决错误】复现RCAN的时候遇到了ImportError: cannot import name ‘_update_worker_pids’ from ‘torch._C’ 2019-04-30
【解决错误】ModuleNotFoundError: No module named ‘skimage‘ 2019-04-30
【深度学习笔记】pytorch的点乘(dot product) 2019-04-30
【深度学习笔记】残差 2019-04-30
【错误解决】cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\sr 2019-04-30
【python学习笔记】读取指定文件夹中的图片,结合边缘保留滤波EPF 2019-04-30
【工具和环境】Linux下安装pycharm 2019-04-30
【Accumulation】The last two sentences of the abstract 2019-04-30
【Accumulation】The definition of SISR 2019-04-30
【工具与环境】Windows下安装Sublime Text 3 2019-04-30
【解决错误】ValueError: some of the strides of a given numpy array are negative. 2019-04-30
【工具与环境】Excel中批量插入行 2019-04-30
【个人实验注意事项】 2019-04-30
【解决错误】ModuleNotFoundError: No module named ‘tqdm‘ 2019-04-30
【解决错误】ModuleNotFoundError: No module named ‘PIL‘ 2019-04-30
【学习笔记】对vanilla的一些个人理解 2019-04-30
【解决错误】json.decoder.JSONDecodeError: Expecting value: line 11 column 14 (char 82) 2019-04-30
【解决错误】The size of tensor a (8) must match the size of tensor b (64) at non-singleton dimension 1 2019-04-30