<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="org.apache.commons.beanutils.*" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<html>
<head>
<title>Viewing Row Sets</title>
</head>
<body>
<h2>Viewing Row Sets</h2>
<bean:define id="cols" name="rowSet" property="dynaProperties"/>
<table border="2">
<tr>
<logic:iterate id="col" name="cols">
<th><bean:write name="col" property="name"/></th>
</logic:iterate>
</tr>
<logic:iterate id="row" name="rowSet" property="rows">
<tr>
<logic:iterate id="col" name="cols">
<td>
<bean:write name="row" property="<%=((DynaProperty)col).getName()%>"/>
</td>
</logic:iterate>
</tr>
</logic:iterate>
</table>
</body>
</html>
-------------------------------------------
<shameless-plug>
Excerpted from the Jakarta Struts Cookbook (http://www.oreilly.com/catalog/jakartastrutsckbk)
</shameless-plug>
-Bill Siggelkow
Olasoji Ajayi wrote:
hi, i obtained an array of DynaBeans from a RowSetDynaClass (thrugh the getRows() method). i dont know the names or culumns of the tables (the query was a SELECT * ). the problem now is how to display the reslults on a jsp page using strut tags, i thought of using the Logic:Iterate tag, how do i code it to iterate over the fields of the DynaBeans, since the iterate tag iterates only on some form of list.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]