You can use c:when/c:otherwise.
You can also negate a test with "not". The following is equivalent to the above.Code:<c:when test="${empty jobs}"> No search result found. </c:when> <c:otherwise> <c:forEach var="current_outer" items="${list}"> <tr> <td><c:out value="${job.title}" /></td> </tr> </c:forEach> </c:otherwise>
Code:<c:when test="${not empty jobs}"> <c:forEach var="current_outer" items="${list}"> <tr> <td><c:out value="${job.title}" /></td> </tr> </c:forEach> </c:when> <c:otherwise> No search result found. </c:otherwise>


Reply With Quote