This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Displaying ResultSets in View Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying ResultSets in View" Watch "Displaying ResultSets in View" New topic

Displaying ResultSets in View

Bloo Barton
Ranch Hand

Joined: May 09, 2005
Posts: 63
I am getting a ResultSet back that has multiple rows in my DAO. I put each row into a DTO and add this to an ArrayList.

My Action class gets the ArrayList back from the DAO. All of this works correctly, but I do not know how to get this data back to the view so I can display the rows in a table.

I have an ActionForm that corresponds with my Action class, but I do not understand how I can put an ArrayList into the ActionForm and then get it back in the JSP since only Strings and booleans are supported in ActionForms.

Any help on this is greatly appreciated.
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 258
your dto with data1 data2.... should be added to a list

and then you can add this list in your form or add it as a request attribute.

in your jsp, do this
I agree. Here's the link:
subject: Displaying ResultSets in View
Similar Threads
How Do I Update An ArrayList in an ActionForm?
This has to be easy! Arraylist?
[URGENT]Problems with Struts and Tiles
Iterate an arraylist of valuobjects in jsp
How to get a complete string from actionmessage in action class