struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <>
Subject Re: Iterating the resultset contents in the view (jsp)
Date Tue, 15 Jul 2003 00:09:12 GMT
--- Richard Hill <> wrote:
> Hi,
> I'm working on an action that gets a resultset from a database table
> containing 4 columns. I need to pass that information back to the view
> (jsp)
> which will iterate over results. My question is what is the best way to
> do
> this. Do I create an array for each row in the resultset and insert each
> array in a collection, passing that back to the view? 

A fairly standard approach is to create a class that represents a row of
your ResultSet and store a List of those objects in the request for the
page to iterate over.  

If you don't want to create a class for each result, you should check out
the BeanUtils DynaBeans.  This little gem:
allows you to transer ResultSet data to DynaBeans in a trivial amount of


> If so, how would you iterate over each array in the collection with the
> logic:iterate taglib? All of the examples only show iterations over
> single
> column lists.
> Any help would be appreciated.
> Thanks,
> Richard
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message