my dog learned polymorphism
The moose likes Spring and the fly likes difference between AbstractFormController & SimpleFormController Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "difference between AbstractFormController & SimpleFormController " Watch "difference between AbstractFormController & SimpleFormController " New topic

difference between AbstractFormController & SimpleFormController

Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 206

Hi All,

I am new to the spring Mvc and tryign to learn different types of controller.
What is the difference between AbstractFormController & SimpleFormController ?

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

It's explained here. Note that SimpleFormController is a concrete implementation of the AbstractFormController.

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 AbstractFormController. The difference is that you do not need to implement showForm, processFormSubmission, and renderFormSubmission: A form view and a success view can be configured declaratively.

[My Blog]
All roads lead to JavaRanch
Costi Ciudatu
Ranch Hand

Joined: Oct 24, 2006
Posts: 74
Are you sure you're not looking for AbstractWizardFormController vs. SimpleFormController ?
AbstractFormController is the support class provided by the framework for form controllers in general.
Simple is the implementation for the trivial case: a form submitted in one step -- it has a form view and a success view. The controller selects the view based on the request method: GET or POST (well, it's actually a lot more than this but you'll find that in the Javadoc).
AbstractWizardFormController on the other hand allows creating a web wizard by populating the command object in several steps (the classic Next, Next... Finish).
But you should be aware that in Spring 3.0 all the *FormControllers have been deprecated in favor of annotated controllers.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: difference between AbstractFormController & SimpleFormController
It's not a secret anymore!