Test if empty in JSTL

Singur suflet pustiu on Flickr

(Photo: Singur suflet pustiu by dani81_const)

This article, Expression Language Overview” href=”http://www.informit.com/articles/article.aspx?p=30946″>InformIT: The JSTL Expression Language > Expression Language Overview, informed me on how to test if something is empty or not.

Empty?

<c:if test="${empty foo}">...</c:if>

Not empty?

<c:if test="${not empty foo}">...</c:if>

Leave a Reply

Your email address will not be published. Required fields are marked *