Evaluate if list is empty JSTL Evaluate if list is empty JSTL java java

Evaluate if list is empty JSTL


empty is an operator:

The empty operator is a prefix operation that can be used to determine whether a value is null or empty.

<c:if test="${empty myObject.featuresList}">


There's also the function tags, a bit more flexible:

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %><c:if test="${fn:length(list) > 0}">

And here's the tag documentation.