Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsp 如何使用JSTL迭代列表_Jsp_Jstl - Fatal编程技术网

Jsp 如何使用JSTL迭代列表

Jsp 如何使用JSTL迭代列表,jsp,jstl,Jsp,Jstl,我有一个这样的列表,所有用户的问题都已分配 userId issueNo issue_desc comments amit t12334 login not happening login via test user not happening amit t1666 session is not cleared after logout session is not c

我有一个这样的列表,所有用户的问题都已分配

userId      issueNo     issue_desc                  comments
amit        t12334      login not happening         login via test user not happening
amit        t1666       session is not cleared      after logout session is not cleared
yash        st5436      Transaction Logs            check transaction logs           
如何使用JSTL实现以下功能

amit
issueNo             issue_desc                      comments
12334               login not happening             login via test user not happening
t1666               session is not cleared          after logout session is not cleared

yash
issueNo             issue_desc                      comments
st5436              Transaction Logs                check transaction logs
或者有没有更好的方式显示此信息?

1)按“用户ID”对用户列表进行排序
2) 使用下一个循环:

<table>
  <thead>
    <th>issueNo</th>
    <th>issue_desc</th>
    <th>comments</th>
  </thead>
  <tbody> 
<c:forEach items="${users}" var="user">
  <c:if test="${empty prevUser or user.userId != prevUser.userId}">
    <tr>
      <td colspan='3' align='left'><c:out value="${user.userId}"/></td>
    </tr>
  </c:if>
  <tr>
    <td><c:out value="${user.issueNo}"/></td>
    <td><c:out value="${user.issue_desc}"/></td>
    <td><c:out value="${user.comments}"/></td>
  </tr>
  <c:set var="prevUser" value="${user}" />
</c:forEach>
  </tbody>
</table>

伊塞诺
问题描述
评论

嘿,它成功了。。。非常感谢你的朋友!!!只需相应地更改数组索引!!!