Here is an example of a body content JSP (nested in a template jsp) that
pulls a Collection bean from the request context (a ResultList from the
Scaffold Struts library). This bean, called listBean, provides and
"applications" property that is also a Collection (ArrayList). The jsp
iterates over the ResultList and over each ArrayList contained in each
element of the ResultList.
I suppose Notes will scramble this code beyond all recognition however,
....
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%-- $Id: results-body.jsp,v 1.7 2003/01/02 22:54:35 bgsmith Exp $ --%>
<html:errors/>
<h3><bean:message key="region.results.header" /></h3>
<center>
<table border="1" frame="border" rules="none" cellspacing="5" cellpadding="6%">
<tr><td align="center" colspan="3"><strong><bean:write name="listBean"
property="legend"/></strong></td></tr>
<logic:notEqual name="listBean" property="size" value="0">
<logic:iterate name="listBean" property="iterator" id="unit">
<tr><td colspan="3">Unit: <strong><bean:write name="unit" property="name"
/></strong></td></tr>
<tr><td colspan="3">Connect String: <bean:write name="unit"
property="connect_string" /></td></tr>
<tr><td colspan="3">Connnection Status: <bean:write name="unit"
property="connect_status" /></td></tr>
<tr align="center">
<td>Application Name</td>
<td>Version</td>
<td>Date Checked</td>
</tr>
<logic:notEqual name="unit" property="size" value="0">
<logic:iterate name="unit" property="applications" id="app">
<tr>
<td align="left"><bean:write name="app"
property="application_name"/></td>
<td align="right"><bean:write name="app" property="version"/></td>
<td align="center"><bean:write name="app"
property="date_tested"/></td>
</tr>
</logic:iterate>
</logic:notEqual>
<logic:equal name="unit" property="size" value="0">
<tr><td align="center" colspan="3"><bean:message
key="simple.results.nodata" /></td></tr>
</logic:equal>
<tr><td colspan="3"><hr width="75%" /></td></tr>
</logic:iterate>
</logic:notEqual>
<logic:equal name="listBean" property="size" value="0">
<tr><td align="center" colspan="3"><bean:message key="simple.results.nodata"
/></td></tr>
</logic:equal>
</table>
<p> </p>
<%-- property="method" --%>
<html:form action="/region-detail-dispatch">
<html:submit property="query">
<bean:message key="button.query"/>
</html:submit>
<html:submit property="menu">
<bean:message key="button.menu"/>
</html:submit>
</html:form>
</center>
<p> </p>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>