jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33054] - sql:query loses query column order
Date Wed, 03 Jan 2007 23:41:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33054>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33054





------- Additional Comments From bayard@apache.org  2007-01-03 15:41 -------
So while I can happily test for this, and we can easily put a SequencedHashMap
in, the spec API for javax.servlet.jsp.jstl.sql.Result defines the method
getRows() as returning a SortedMap and not a Map.

SequencedHashMap is not a SortedMap - the insertion-ordering that this issue
calls for doesn't match the SortedMap API which indicates ordering should be
managed via  comparator.

It would be possible to hack the fork of SequencedHashMap around a bit to make
it a SortedMap implementation (given that it won't be public); but I think
that's abusing the spec far too much.

---

Looking at the sample page, I believe the following is a useable workaround for
this issue:

  <%-- Get the column names for the header of the table --%>
  <c:forEach var="columnName" items="${db.columnNames}">
    <th><c:out value="${columnName}"/></th>
  </c:forEach>

  <%-- Get the value of each column while iterating over rows --%>
  <c:forEach var="row" items="${db.rowsByIndex}">
    <tr>
      <c:forEach var="column" items="${row}">
        <td><c:out value="${column}"/></td>
      </c:forEach>
  </c:forEach>

We should put that in a FAQ.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message