tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gisella Saavedra" <>
Subject RE: JSTL SQL library
Date Mon, 09 Sep 2002 02:19:43 GMT
I need some help here!

sessionScope.hdf is the Result variable from a query.

I'm having a problem with displaying the results of a query in the order
of the column names, without knowing the column names:

<c:forEach items="${sessionScope.hdf.rows}" var="row" >
	     <c:forEach items="${row}" var="col" >
             <td><c:out value="${col.value}"/></td>

The inner look picks up the values in the  rowsByIndex order.
I tried changing the inner loop to

<c:forEach items="${sessionScope.hdf.columnNames}" var="col" varStatus="s" >
       <td><c:out value="${row[${col}]}"/></td>

and it failed.

Does somebody know if there is a way to loop at the result of a query
and print the values as the columnNames order (which is the order
of the SELECT statement  columns?

I do not see the rationale of the rowsByIndex of having the query
columns in a different order
than the corresponding columnNames order.
In JDBC, I believe the ordinal position of the resulting columns is
the same as the order of the names in the SELECT list.

I'd appreciate some help.  Developing with JSTL is taking longer than



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message