• JSP (JavaServer Pages)

    JSTL - Core <c:if> Tag

    The <c:if> tag evaluates an expression and displays its body content only if the expression evaluates to true. The <c:if> tag has the following attributes −

    Attribute Description Required Default
    test Condition to evaluate Yes None
    var Name of the variable to store the condition's result No None
    scope Scope of the variable to store the condition's result No Page
    Example
    <c:if test="${condition}">
    </c:if>
    
    <c:choose>
        <c:when test="${condition}">
        </c:when>
        <c:otherwise>
        </c:otherwise>
    </c:choose>
    

    Ref: TutorialsPoint: JSP - https://www.tutorialspoint.com/jsp/jstl_core_if_tag.htm