I'm trying to tell my program to print out a message on every product if there is less than 5 products in a given category. But when I test the condition in my browser, when I click on a category (even if the category has more than 5 prods.), the page goes blank and the logs flag this following error:
java.lang.IllegalArgumentException: Cannot convert {[entity.Product[ id=36 ], entity.Product[ id=37 ], entity.Product[ id=38 ], entity.Product[ id=39 ], entity.Product[ id=160 ]]} of type class org.eclipse.persistence.indirection.IndirectList to class java.lang.Long
I think there is something wrong with my c:if
condition.
<c:set var="product" value="${categoryProducts}"/>
<c:if test="${categoryProducts > 5}">
<div id="pd_msg">SALE!</div>
</c:if>