Brian Kremmin wrote:
I'm planning to use an ArrayList to store the data and use the
logic:iterate tag to expose the elements of the list... however, I'm
unsure of the proper structure of all these data objects. I think I'm
using struts 1.1 if that makes a difference.
1) I'd tend towards using JSTL rather than the Struts tags when the
functionality is identical.
2) Put an ArrayList of JavaBeans into the "appropriate" scope (probably
request?)
IOW, your ArrayList will contain a collection of JavaBeans with getters
for each column you want exposed. Say you have a user represented by
firstname, lastname, and ssn. So your bean would have getFirstname,
getLastname, and getSsn methods.
In your Action you'd do something like:
request.setAttribute("users", userArrayList);
In your JSP you'd do something like (in JSTL; struts beans are quite
similar):
<table>
<c:forEach items="${users}" var="user">
<tr>
<td><c:out value="${user.firstname}"/> <c:out
value="${user.lastname}"/></td>
<td><c:out value="${user.ssn}"/></td>
</tr>
</c:forEach>
</table>
or whatever.
Again, the hour or two of investment in "learning" JSTL is worth it for
tags that don't explicitly need Struts functionality, but on a practical
level that may not make any difference to you.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]