Prev Next

Web / JSP interview questions

if-else option in JSTL.

<c:if> tag does not have else tag. So we can use <c:choose> as illustrated below for if-else if- else scenario.

<c:choose>
  <c:when test="${condition1}">
    ...
  </c:when>
  <c:when test="${condition2}">
    ...
  </c:when>
  <c:otherwise>
    ...
  </c:otherwise>
</c:choose>

More Related questions...

Show more question and Answers...


Comments & Discussions