我需要使用JSTL選擇語句來實現一個switch case,我有不同的選擇樹。 任何人都知道下面的代碼不起作用的原因?JSTL c:選擇問題
在此先感謝。
<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>
如果打印出'$ {iUserInfo.identification_card_type}'這個表達式,你會得到一個結果嗎?據我所知,'== 1'應該足夠了。 – reporter 2011-06-06 12:36:31
我試過了,它仍然不起作用,我認爲這是不夠的.. :( – Kevin 2011-06-06 12:43:37