Form controller that auto-populates a form bean from the request.
This, either using a new bean instance per request, or using the same bean
when the sessionForm property has been set to true.
This class is the base class for both framework subclasses like
AbstractWizardFormController , and
custom form controllers you can provide yourself.
Both form-input views and after-submission views have to be provided
programmatically. To provide those views using configuration properties,
use the SimpleFormController .
Subclasses need to override showForm to prepare the form view,
and processFormSubmission to handle submit requests. For the latter,
binding errors like type mismatches will be reported via the given "errors" holder.
For additional custom form validation, a validator (property inherited from
BaseCommandController) can be used, reporting via the same "errors" instance.
Comparing this Controller to the Struts notion of the Action
shows us that with Spring, you can use any ordinary JavaBeans or database-
backed JavaBeans without having to implement a framework-specific class
(like Struts' ActionForm). More complex properties of JavaBeans
(Dates, Locales, but also your own application-specific or compound types)
can be represented and submitted to the controller, by using the notion of
a java.beans.PropertyEditor. For more information on that
subject, see the workflow of this controller and the explanation of the
(and that defined by superclass):
In session form mode, a submission without an existing form object in the
session is considered invalid, like in case of a resubmit/reload by the browser.
The handleInvalidSubmit method is invoked then,
by default trying to resubmit. It can be overridden in subclasses to show
corresponding messages or to redirect to a new form, in order to avoid duplicate
submissions. The form object in the session can be considered a transaction
token in that case.
Note that views should never retrieve form beans from the session but always
from the request, as prepared by the form controller. Remember that some view
technologies like Velocity cannot even access a HTTP session.
Exposed configuration properties
(and those defined by superclass):