> Then I have lots of "display information only"-pages. Most of > these are tables that are based on some sort of DB table. Right now I: > Call a struts Action. > The Action retrieves the data, populates a boatload of Beans. > The Beans are stuffed into a List, which in turn is put into > a List which > resides in my Form. > The jsp retrieves the Form. > The jsp performs a <logic:iterate id="bean" name="myForm" > property="myList" > indexId="i"></logic:iterate> > The information is output with a lot of bean:write's
If it's display-only, I have an Action which uses my DAO layer to talk to the database and puts beans in some scope. Then the JSP uses JSTL tags to display the data (or bean:write in your case-- IIRC bean:write will work with beans other than Form beans, you just have to tell it where to get the data). I agree, you're making it more complex than it needs to be. No matter how simple your webapp is now, it's a REALLY REALLY bad idea to talk to the database from the JSP. Resist the temptation, it will make your life easier in the future. IMO even the Actions shouldn't talk directly to the database-- my Actions get a Data Access Object and call 'read' or 'update', remaining blissfully ignorant about what's happening behind the scenes. So Struts only gets involved with the ".do" mapping and figuring out which action to call. I don't bother with a Form bean if it's display only. Similarly, if a plain old HTML tag will do the job, I don't use a Struts tag-- it the output isn't dynamic, why bother? -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

