How to use Boolean variable in c:if
- by Patriks
I am using this code in jsf
<c:if test="#{sV.done.booleanValue()}">
<option value="#{sV.id}" selected="selected">#{sV.text}</option>
</c:if>
<c:if test="#{not sV.done.booleanValue()}">
<option value="#{sV.id}">#{sV.text}</option>
</c:if>
sv is my class containing data (pojo), done is an Boolean variable, I want to display option tag with selected attribute if sV.done is true.
But I couldn't make it. Don't know where I am wrong.
Otherwise there can be something worong with c? because c:forEach was not working before some time in my case in same page. it can be the reason? Where I am wrong?