• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between AbstractFormController & SimpleFormController

 
Rahul Ba
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

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

Regards,
Rahul
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Costi Ciudatu
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic