Both solution 1 and 2 are far better than using a ResultSet in a jsp. I usually use a Collection of JavaBeans.

David



From: Guido <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Data driven struts application
Date: Fri, 14 Mar 2003 16:24:08 +0100

95% of my struts web apps follow this flow:

1. User selection in a JSP
2. Action class performs a SQL query
3. Return ActionForward to a new JSP that renders the query ResultSet

What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets)

Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to:

+ solution 1. Use a RowSetDynaClass instead of the ResultSet.
+ solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?)
+ solution 3. I don't know... :(


Thank you very much,
Guido.

PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection??



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


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to