I am updating user status(true,false) form jsp page , here i am getting user status from controller class and displayed in option box , here i am using <c:when>
jstl tag. see the below code
<c:choose>
<c:when test="${roamingDenied == 'True')">
<option value="True" selected>True</option>
<option value="False">False</option>
</c:when>
<c:otherwise>
<option value="True">True</option>
<option value="False" selected>False</option>
</c:other开发者_运维技巧wise>
</c:choose>
above code always displayed "False", plz any one give me suggestion for that..
The condition should be just
${roamingDenied}
or
${roamingDenied == true}
Also, there is a typo in your expression. It should be within {
and }
. Yours ends in a )
.
It depends on the type of the value of attribute roamingDenied. Perhaps your roamingDenied is boolean not String like adarshr adviced.
精彩评论