Java Reference
In-Depth Information
Since the request parameter used in the
<c:if>
tag condition was not present, the
markup in its body was not rendered. Modifying the URL, so that the parameter is
there and has the expected value, results in the conditional markup being rendered.
Displaying Mutually Exclusive Markup with
the <c:choose> Tag
One disadvantage of the
<c:if>
JSTL tag, discussed in the previous section, is
that there is no way to display markup if (and only if) the expression in its
test
attribute evaluates to
false
. If we need this kind of functionality, we need the JSTL
<c:choose>
tag.
Just like with the
<c:if>
tag, we can drag-and-drop the
JSTL Choose
item from the
NetBeans palette into our page.