I've been using the Action classes to load the required data for the form and place it under session object if the data does change often and the dropdown is being used repeatedly. This way, you don't have to when back to the database everytime. The draw back to this technique is that the scalability issue. Just be sure to remove these collections from the session object when you are done.
I am very much interest in seeing other techniques being used. -----Original Message----- From: Rick R [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 12:30 PM To: [EMAIL PROTECTED] Subject: Where is it best to populate default form bean collections etc? Sorry if I'm not to clear here but I'm really curious about the best design principle to use under struts in the following situation... Say you want to set up a jsp form and on the form you have several select elements. Each set of select elements is created dynamically from a query to the database. I have a corresponding form bean that goes with this page. The question I have is it ok to set up the default select lists inside the form bean by calls to some other business logic? For example... private dogsArray = business.getDogsArray(); then your normal set and get method. I tend to thin this probably isn't a good idea and it would be best to have some action class create the array and then call the appropriate form bean set method. I'm not sure though. Then what about when the form is reset, I take it you just make another call to the default action that sets up your form bean? I noticed in some of the examples they have a reset() method inside the form beans which goes and sets the fields to default values. This is why I began questioning the best practices, since if I follow that route than I really would have to call some business logic to populate the String[] arrays for the select options in the form beans. Hopefully I'm making some sense. Thanks for any advice. Rick -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>