The best solution IMHO is to mimic/steal the way Swing does it.

Instead of using an ArrayList, create objects that implement the swing
ListModel or TableModel interfaces.
That way, it's also very easy to create nice debugging/admin apps with the
same components (remember, reuse is what it's all about). And then you
create your JSP helper classes (might be beans, might be tag library) to
convert create the 'Views' for your models.
It's not that difficult to create a class that uses the swing.TableModel to
render an HTML representation for it. Same for lists. Create HTML components
to convert the ListModel data to comboboxes, <UL>, ...

Since we're on the subject, you might take it one step further and create a
jdbc RowSet implementation that also implements the swing TableModel
interface. This could be really the summum for web development. And we're
talking about completely generic components here.

I'll be doing some of these things as well. I'll try to keep you updated.

Good luck,

Geert

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Aaron O'Hara
> Sent: dinsdag 24 april 2001 21:42
> To: [EMAIL PROTECTED]
> Subject: Displaying data in N-Tier systems
>
>
> All,
>
> When it comes to presenting data in the presentation layer, what are the
> "best practices"?  Common operations like populating a select list and a
> table are frequent in form-heavy applications and I'm wondering what the
> best ways are?
>
> Usually the source of a select list or table is a query result
> which I then
> map to an ArrayList.  From there, I use a tag extension to iterate through
> the ArrayList.  Is this optimal?  What other methods have been used to
> success?
>
> Aaron O'Hara
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to