Ruslan Lomov
Ruslan Lomov

Reputation: 485

How to make condition if List is not empty or null in JSP?

List from controller received. How to check if it is not null, then show some information and else skip show?

<c:forEach items="${itemList}" var="item">

Upvotes: 2

Views: 4541

Answers (1)

JB Nizet
JB Nizet

Reputation: 692181

<c:if test="${!empty itemList}">
    the list is neither empty nor null
</c:if>

Upvotes: 3

Related Questions