I have a display tag in which I want to check a value of a specific condition and display the value in two ways.
<c:choose>
<c:when test="${itemList.count>0}">
//display one way
</c:when>
<c:otherwise>
//display another way
</c:otherwise>
</c:choose>
but the line <c:when test="${itemList.count>0}">
is hitting java.lang.NumberFormatException: For input string: "count"
if there is no data to show in display table. If there is data to show, it works well though.
How can I check the value of count to avoid hitting exception if there is no data to show?
But with the following code which doesn't check the condition and just display the data, it doesn't hit exception even if there is no data or data to show in display tag table.
<display:column class="colCount" property="count"
title="${titleCount}" sortable="true" headerClass="sortable"/>
when I just use like this, all ok. Instead of <c:when test="${itemList.count>0}">
, use <c:when test="${count>0}">
<c:choose>
<c:when test="${count>0}">
//display one way
</c:when>
<c:otherwise>
//display another way
</c:otherwise>
</c:choose>