Struts ActionForms |
ActionForms can be stored in either the request (preferable) or session (default) scope. If they're in the session scope it's important to implement the form's reset method to initialize the form before each use. ActionForms should be request based unless they are carried across more than one page, as is the case for our mortar ActionForm, SearchHelpParamsForm, used in all or our apps with action path /SearchHelpNavAction (see struts-config). But 99% of all others should be request scope.
By definition, every ActionForm must be a subclass of org.apache.struts.action.ActionForm.
A form's job is data input. It should not be used for data output unless some of that data is used as input too (this does not mean dropdowns, etc). Output data should be stuffed into the request by using request.setAttribute. You can then access the data in the jsp using the c taglib. Any data that is required for more than one screen, e.g. dropdown data that doesn't change, etc, can be stored in the session.