This week's giveaways are in the MongoDB and Jobs Discussion forums. We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line! See this thread and this one for details.
Hi there, You'll want to read up on DynaActionForms and DynaValidatorActionForms in Struts 1.1 documentation. These classes extend the ActionForm class and allow you to define forms in the struts-config.xml file instead of as a hard-coded class. You might also want to read up on the other subclasses of DynaAction form to see if there are any that behave as you need. Darryl
Joined: Dec 19, 2002
Depending on the nature of your form, you can also use array properties in your form bean. i.e. if you will have multiple rows of the same content, this would be an easy solution. If this is your problem, there should be plenty of docs available. Otherwise, you can use the aforementioned dynamic forms. Or, you can use what is still a better method IMHO and simply make multiple forms. Of course, it all depends on your needs.
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Joined: Apr 19, 2002
In my ActionForm, I've a set of basic fields that are static, eg. username, password and such. Other than that, we are allowed to attach new fields dynamically as setup by some config files. I'll look into DynaAction form to see whether it'll solve the problem. I doubt it because dyna action form requires me to code the XML before hand. For now, I'm parsing the parameters manually from the request inside Action class.
Joined: Feb 27, 2003
Chu, I'm interested in what you find. I've got a similar problem. I am planning on parsing XML, manually writing JSP for the form and the DynaActionForm in the <form-bean> struts-config.xml section. If anybody has a better idea I'm all ears. Thanks and Regards, David