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 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" >
	   <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.
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.


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
expected.

Thanks,

Gis

--
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