struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Derry" <>
Subject Re: Newbie: pass ResultSet to JSP?
Date Sat, 22 Jun 2002 01:43:57 GMT
As you found, you cannot pass the ResultSet back to your JSP. This would not
be a good thing if you could. That would be coupling your data layer too
closely with your view layer. A better solution is to populate a Collection
object with the data in your ResultSet, and pass that back to your JSP
(through a controller such as an Action object I assume).

There has also been some discussion about RowSets, but I haven't had a
chance to look into them.


----- Original Message -----

> Subject: Newbie: pass ResultSet to JSP?
> From: "David Chu" <>
>  ===
> I am trying to get my head around this struts framework for the first
> I am confused about the best/standard way to access data from a JSP.
> - Let's say I want a page list_items.jsp.
> - I have access to a bean that has a method that returns the results of a
> database query as a ResultSet object.
> - How should I iterate through the rows of the bean?
> - Complication: my jsp complains that the ResultSet object has been closed
> (because I closed the query)
> Is this the prefered encapsulator of data that I should be accessing
> my JSP?  Hopefully I can use the <struts-logic:iterate> tag.
> Thanks for helping out a new struts developer!
> -david

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

View raw message