- c:if (沒有c:else)
<c:if test="${age > 20}">age大於20</c:if> //age大於20時,返回true
<c:if test="${falg}">flag爲true</c:if> //flag是一個布爾值,如果不是,那麼頁面會有類型不匹配的報錯
<c:if test="${empty str}">str爲空</c:if>//判空,相當於<s:if test="str==''"></s:if>
<c:if test="${not empty str}">str不爲空</c:if>//判空,相當於<s:if test="str!=''"></s:if>