Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Do I have to have a separate ActionForm bean for every HTML form?

actionform bean form html separate
0
Posted

Do I have to have a separate ActionForm bean for every HTML form?

0

This is an interesting question. As a newbie, it is a good practice to create a new ActionForm for each action sequence. You can use DynaActionForms to help reduce the effort required, or use the code generation facilities of your IDE. Some issues to keep in mind regarding reuse of form beans are as follows: • Validation – You might need to use different validation rules depending upon the action that is currently being executed. • Persistence – Be careful that a form populated in one action is not unexpectedly reused in a different action. Multiple entries in struts-config.xml for the same ActionForm subclass can help (especially if you store your form beans in session scope). Alternatively, storing form beans in request scope can avoid unexpected interactions (as well as reduce the memory footprint of your application, because no server-side objects will need to be saved in between requests. • Checkboxes – If you do as recommended and reset your boolean properties (for fi

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123