Java Reference
In-Depth Information
<p>
This paragraph will always be displayed.
</p>
<p>
<c:choose>
<c:when
test="${param.displayConditionalText == '1'}">
This paragraph will only be displayed if the request
parameter named "displayConditionalText" has a value
of "1".
</c:when>
<c:when
test="${param.displayConditionalText == '2'}">
This paragraph will only be displayed if the request
parameter named "displayConditionalText" has a value
of "2".
</c:when>
<c:otherwise>
This paragraph will only be displayed if the request
parameter named "displayConditionalText" is either not
present or has a value different from "1" or
"2".
</c:otherwise>
</c:choose>
</p>
<p>
This paragraph will also always be displayed.
</p>
</body>
When executing the JSP by right-clicking on it and selecting Run File, no request
parameter is added to the URL, therefore we see the text inside the <c:otherwise>
tag displayed in the rendered page.
 
Search WWH ::




Custom Search