This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying ResultSets in View

 
Bloo Barton
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your dto with data1 data2.... should be added to a list
list.add(data1)

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

in your jsp, do this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic