An ActionForm is a java bean that extends org.apache.struts.action.ActionForm, ActionForm maintain the session state of web application.
All data submitted by the user are sent corresponding ActionForm
ActionForm class is used to capture user-input data from an HTML form and transfer it to the Action Class. ActionForm plays the role of Transport Vehicle between the presentation Tire & Business Tier.
Life Cycle :
1. Request received by Controller
2. Create or recycle ActionForm
3. Call reset()
4. store ActionForm in proper scope
5. populate ActionForm from Request
6. Validate the ActionForm
7. If errors found then forward back to input attribute page(configured in Action mapping in struts-config.xml) with ActionForm in scope. If no errors found then call execute() with the ActionForm.
Filed under: Struts
Very nicely explained.. Thanks.