我的动作类有一个像这样的对象数组,
Object[] varCount = (Object[]) countList.get(0);
我的调试显示了 varCount 的值。我将此对象数组放入模型中,如下所示:
model.put("varCount ", varCount );
在 JSP 中我迭代如下:
<c:forEach var="varCount " items="${model.varCount }" varStatus="loop">
<tr>
<td align="center"> <c:out value="${varCount[0]}"/></td>
</tr>
</c:forEach>
我得到以下错误:
Wrapped exception:
javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${varCount [0]}": Unable to find a value for "0" in object of class "java.math.BigDecimal" using operator "[]" (null)
at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:306)
at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:16
我如何获得价值?