You could have a collection/array of fields that needed to be displayed. You would iterate on each record in the result set. For each row, you would then iterate thru the collection of field names, using the field name as a key to the record "bean". I'd do it something like below, though there may be some syntax errors (particularly the c:out line, it's from memory). Again, this only works if your records are key/value pairs (e.g. a Map) that can be evaluated by the JSTL and EL.
<c:set var="fieldList" value="${myFieldList}"/> <c:set var="records" value="${myRecordList}"/> ... <!-- print out record header --> <tr> <c:forEach var="field" value="${fieldList}"> <th><c:out value="${field}"/></th> </c:forEach> </tr> <c:forEach var="record" items="${records}"> <tr> <c:forEach var="field" items="${fieldList}"> <td><c:out value="${record[field]}"/></td> </c:forEach> </tr> </c:forEach> ... -ed On 7/28/05, Dave Newton <[EMAIL PROTECTED]> wrote: > Konrad Billewicz wrote: > > >How would you handle it? > > > > > If the columns are all formatted the same (or even if they're not and > I'm feeling saucy) I might consider writing a custom tag that does the > entire report (maybe outputting XML for easy format changes? I dunno) or > iterating over a collection of "columns to show" and using existing or > custom tags to output the appropriate value or table cell. > > Or I might just have a million <c:if...> tags, but I really hate JSP > pages like that. > > Dave > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]