I'm trying to setup a form that will populate with the information about a user (their name, address, etc.) I'm having trouble with this because I don't really understand how the ActionFormBeans work.
Struts uses ActionForms to both populate a HTML form, and then to capture the parameters when a form is submitted.
When a request is submitted, the ActionServlet matches the URI for the request against the path of an action-mapping. If there is a form-bean for that action-mapping, it looks for an ActionForm under the form-bean name. If it doesn't find one, a new one is created. The ActionServlet then calls reset() on the new or pre-existing ActionForm and populates it from the request. If the action-mapping has validate set to true, the ActionServlet calls the validate method. If this returns any error messages, the ActionServlet forwards to the URI indicated by the action-mappings error property. This is often a JSP, but it can also be another action-mapping. The latter being needed when there are drop-down controls to populate and so forth. If there are no errors, the ActionServlet passes the (populated and validated) ActionForm to the Action indicated by the action-mapping element.
It's important to note that the form-bean name is used as the default attribute name. Another attribute name can be specified in the action-mapping if needed. Likewise, the html tags default to using the ActionForm related to the html:form tag, but any bean can be specified for any html tag element (ActionForm or not).
When passing ActionForm beans between Actions it is important to note that the ActionServlet will try to populate it again between Actions. If you modify a value, you must be sure to protect it from autopopulate or reset. One way to do that is to add a mutable switch to your ActionForm bean. See SuperForm for an example