我使用了El,但它無效。 我收到一個錯誤:javax.el.ELException: Cannot convert 1 of type class java.lang.String to class java.lang.Long
。 1是計數。在JSP中使用EL時出錯
<h3>My Shopping</h3>
<c:set var="count" value=" ${sessionScope.cart.count}" />
${count}
<%--
<c:set var="cart" value="${sessionScope.cart}" />
<c:set var="count" value=" ${sessionScope.cart.count}" />
<br/>
<c:if test="${count < 1}" >
No Product in your cart
</c:if>
<c:if test="${count > 0}">
<c:set var="listCart" value="${sessionScope.cart.cart}" />
你能關閉刪除死代碼的評論嗎? – Florent