I need to implement a switch case using JSTL choose statement, I have tree different choise.
Anyone knows the reason why the code below doesn’t work?
Thanks in advance.
<c:choose>
<c:when test="${iUserInfo.identification_card_type}==0">
<option selected="selected">Carta di Identità</option>
<option>Passaporto</option>
<option>Patente di Guida</option>
</c:when>
<c:when test="${iUserInfo.identification_card_type}==1">
<option>Carta di Identità</option>
<option selected="selected">Passaporto</option>
<option>Patente di Guida</option>
</c:when>
<c:when test="${iUserInfo.identification_card_type}==2">
<option>Carta di Identità</option>
<option>Passaporto</option>
<option selected="selected">Patente di Guida</option>
</c:when>
<c:otherwise>
<option>Scegli...</option>
<option>Carta di Identità</option>
<option>Passaporto</option>
<option>Patente di Guida</option>
</c:otherwise>
</c:choose>
Because you didn’t evaluate the entire expression inside
${}. Fix it accordingly: