9

What is the equivalant of if()else if()else if() in JSTL I tried using

<c:choose>
  <c:when></c:when>
  <c:when></c:when><c:otherwise> 
  <c:when></c:when>
  </c:otherwise>
</c:choose>

but it was giving error.

skaffman
  • 398,947
  • 96
  • 818
  • 769
sachin gk
  • 585
  • 3
  • 6
  • 11
  • 1
    you can check this http://stackoverflow.com/questions/4587397/how-to-use-if-else-option-in-jstl i think it answers your question – Khaled Aug 23 '11 at 11:35

1 Answers1

21

That's because your mixed up your tags. It should be:

<c:choose>
  <c:when test="..."> ... </c:when>
  <c:when test="..."> ... </c:when>
  <c:otherwise> ... </c:otherwise>
</c:choose>
skaffman
  • 398,947
  • 96
  • 818
  • 769