Last active
December 25, 2015 14:19
-
-
Save springcome/6989601 to your computer and use it in GitHub Desktop.
<c:forEach example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// list | |
<c:choose> | |
<c:when test="${empty data}"> | |
<!-- data is empty --> | |
</c:when> | |
<c:otherwise> | |
<c:forEach var="dt" items="${data}" varStatus="status"> | |
<c:out value="${dt.name}" /> | |
</c:forEach> | |
</c:otherwise> | |
</c:choose> | |
// list for list | |
<c:choose> | |
<c:when test="${empty data}"> | |
<!-- data is empty --> | |
</c:when> | |
<c:otherwise> | |
<c:forEach var="dt" items="${data}" varStatus="status"> | |
<c:forEach var="child" items="dt.list" varStatus="status"> | |
<c:out value="${child.name}" /> | |
</c:forEach> | |
</c:forEach> | |
</c:otherwise> | |
</c:choose> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment