Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of "if elseif elseif" in JSTL

Tags:

jsp

jstl

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.

like image 207
sachin gk Avatar asked Aug 23 '11 11:08

sachin gk


Video Answer


1 Answers

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>
like image 89
skaffman Avatar answered Oct 19 '22 16:10

skaffman