"assign the arraylist" in the Action like:

request.setAttribute("myArrayListOfBeans", theList);

Then in the forwarded to jsp

<slogic:iterate id="row" name="myArrayListOfBeans">
    <bean:write name="row" property="firstProperty">
    <bean.write name="row" property="nextProperty">
</slogic:iterate>

----- Original Message -----
From: "Luna, Kat" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2001 8:36 AM
Subject: RE: Displaying data retrieved from a database


> Michael,
>
> What exactly do you mean when you say "assign the arraylist"?  I
believe I
> have all the beans in place to retrieve from the database and store in
an
> arraylist, but when I try to iterate through the bean from the jsp
page, I
> get "scope = null" which makes me think that I am missing this step of
> assigning the ArrayList to make it accessible to the JSP page.
>
> Thanks,
>
> Kat
>
> -----Original Message-----
> From: Michael Mok [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 12, 2001 1:25 AM
> To: [EMAIL PROTECTED]; 'Jonathan Asbell'
> Subject: RE: Displaying data retrieved from a database
>
>
> Jonathan
>
> A way of doing this is to use the java.util.ArrayList object. If you
have a
> bean to represent a row of data eg
>
> TableRow
> CustID        FirstName    LastName
>
> RowBean
>
> Integer CustId; /* with get and set Methods */
> String FirstName;/* with get and set Methods */
> String LastName;/* with get and set Methods */
>
> In your action perform, you can loop through your resultset, create a
new
> RowBean for each Row and add it to the arraylist. You can then either
assign
> the arraylist to the response object or the session object. In your
JSP
> page, use the iterate tag to loop through your list.
>
> The other option is to use the CacheResultSet from sun but I have not
> venture into that area. There are a number of discussions in this list
about
> using the CacheResultSet.
>
> Regards
>
> Michael Mok
> www.webappcabaret.com/normad <http://www.webappcabaret.com/normad>
>
>
>
> -----Original Message-----
> From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 12 June 2001 10:09
> To: [EMAIL PROTECTED]
> Subject: Displaying data retrieved from a database
>
>
> I was interested in how you all were displaying data retrieved from a
> database.  My notion is that in your Actions perform() method you will
make
> calls and get results.  But where do you put the results?  Do I save
the
> data to a bean which I pass in the request to a waiting Tag class on
the
> page I will forward to, and have that Tag class iterate through the
beans
> data? This means I have to make Tag classes to read in passed beans.
>
> How are you all doing this in general.  I am very interested.
>
> Jonathan
>
>

Reply via email to