On Sun, 8 Sep 2002, Gisella Saavedra wrote:

> <c:forEach items="${sessionScope.hdf.rows}" var="row" >
>          <tr>
>            <c:forEach items="${row}" var="col" >
>              <td><c:out value="${col.value}"/></td>
>            </c:forEach>
>          </tr>
> </c:forEach>
> 
> The inner look picks up the values in the  rowsByIndex order.

Actually, ${row} here references a SortedMap; the order is lexical.

> I tried changing the inner loop to
> 
> <c:forEach items="${sessionScope.hdf.columnNames}" var="col" varStatus="s" >
>        <td><c:out value="${row[${col}]}"/></td>
> </c:forEach>
> 
> and it failed.

${} applies to a whole expression, not a variable.  Instead of

  ${row[${col}]}

simply write

  ${row[col]}

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to