• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Displaying ResultSets in View

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic