Concrete FormController implementation that provides configurable form and success views, and an onSubmit chain for convenient overriding. Automatically resubmits to the form view in case of validation errors, and renders the success view in case of a valid submission.
The workflow of this Controller does not differ much from the one described in the {@link AbstractFormController AbstractFormController}. The difference is that you do not need to implement {@link #showForm showForm} and{@link #processFormSubmission processFormSubmission}: A form view and a success view can be configured declaratively.
Workflow (in addition to the superclass):
successView
. Consider implementing {@link #doSubmitAction} doSubmitActionfor simply performing a submit action and rendering the success view.The submit behavior can be customized by overriding one of the {@link #onSubmit onSubmit} methods. Submit actions can also performcustom validation if necessary (typically database-driven checks), calling {@link #showForm(HttpServletRequest,HttpServletResponse,BindException) showForm}in case of validation errors to show the form view again.
Exposed configuration properties (and those defined by superclass):
name | default | description |
formView | null | Indicates what view to use when the user asks for a new form or when validation errors have occurred on form submission. |
successView | null | Indicates what view to use when successful form submissions have occurred. Such a success view could e.g. display a submission summary. More sophisticated actions can be implemented by overriding one of the {@link #onSubmit(Object) onSubmit()} methods. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|