Brian Kremmin wrote:
I want to get some table data from a database and output it in table
form on a webpage.

I'm planning to use an ArrayList to store the data and use the
logic:iterate tag to expose the elements of the list... however, I'm
unsure of the proper structure of all these data objects.  I think I'm
using struts 1.1 if that makes a difference.

I'm assuming I'll create a form bean with an ArrayList as a property..
is this correct?  However, I'm unsure of what sort of objects to put
into the array list.  Do I create another form bean with properties for
each table column, populate a new bean for each row of table data, and
put each into the ArrayList?  Or should the objects in the Arraylist be
something other than a form bean?

If you just need to display the data, you don't need FormBeans or anything else Struts-specific. Use whatever data structures make sense to your application and pass them to your view (JSP), as others have posted here.

If you need to let the user edit and re-submit the data, validate it, re-display it, etc. then you will want to start using FormBeans and the rest of the Struts machinery to manage that.

For output-only data, you just need to expose the model (whatever form you choose for that). Struts is model-agnostic.

I'm looking for the 'best' and 'proper" practice as our standards group
is very picky.  Any ideas?

If you need to satisfy a picky standards group maybe you should ask what *they* consider to be the 'correct' way to do this in your organization :-)

L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to