cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pelssers, Robby, VF-NL" <robby.pelss...@vodafone.com>
Subject JSTL question (how to get length or size of array)
Date Wed, 15 Mar 2006 13:14:19 GMT
Hi guys,
 
Scenario:
 
I get an array of Extensions from the controller and the .name works
just fine.  An extension has a array of Parameters (key-value).  I was
wondering how I could display the amount of parameters an extension has.
The code commented out returns following error.
 
Kind regards,
Robby Pelssers
 
javax.servlet.jsp.JspException: An error occurred while evaluating
custom action attribute "value" with value
"${extension.parameters.length}":
The "." operator was supplied with an index value of type
"java.lang.String" to be applied to a List or array, 
but that value cannot be converted to an integer. (null)
 
serviceprovider.jsp 
------------------------------------------------------------------------
-------------------
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
 
<html>
<head><title>Provisioning GUI</title></head>
<body>
<table>
  <c:forEach items="${model.spextensions}" var="extension">
    <tr>
      <td><c:out value="${extension.name}"/></td>
<!--
      <td><c:out value="${extension.parameters.length}"/></td>
-->
    </tr>
  </c:forEach>
</table> 
</body>
</html>
------------------------------------------------------------------------
-------------------

Mime
View raw message