java - JSTL getting values from Object array -


my action class has object array this,

object[] varcount = (object[]) countlist.get(0);  

and debug shows values varcount. put object array in model follows:

model.put("varcount ", varcount ); 

and in jsp iterate follows:

<c:foreach var="varcount " items="${model.varcount }" varstatus="loop">      <tr>      <td align="center">&nbsp;<c:out value="${varcount[0]}"/></td> </tr>      </c:foreach> 

and foll error:

wrapped exception: javax.servlet.jsp.jspexception: error occurred while evaluating custom action attribute "value" value "${varcount [0]}": unable find value "0" in object of class "java.math.bigdecimal" using operator "[]" (null)     @ org.apache.taglibs.standard.tag.common.core.importsupport.acquirestring(importsupport.java:306)     @ org.apache.taglibs.standard.tag.common.core.importsupport.doendtag(importsupport.java:16 

how values?

use array objects

<c:foreach var="item" items="${model.varcount }" varstatus="loop">  <tr>  <td align="center">&nbsp;<c:out value="${item}"/></td>   </tr>  </c:foreach> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -