語法為:「empty」、「not empty」。
<c:if test="{empty var1}">
var1 is empty or null.
</c:if>
<c:if test="{not empty var1}">
var1 is NOT empty or null.
</c:if>
留意:被測試的值(如上的var1)不管為 null 或 空值,都視為「empty」。
參考:
jsp - Evaluate empty or null JSTL c tags - Stack Overflow
文章標籤
全站熱搜
