tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gisella Saavedra" <gisel...@yachay.net>
Subject RE: JSTL SQL library
Date Mon, 09 Sep 2002 03:06:17 GMT
Thank you Shawn!  It worked!

-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Sunday, September 08, 2002 7:43 PM
To: Tag Libraries Users List; gisellas@yachay.net
Subject: RE: JSTL SQL library


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:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message