• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SimpleFormControllers in Spring MVC

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a question about the controllers AbstractController and SimpleFormController. From what I understand for read-only dynamic pages AbstractController is the very basic one to use. Whereas SimpleFormController handles both GET and PUT requests - so it serves 2 purposes. Am I right?

The application I am working on has 1 controller behind each dynamic view, when the Submit button on that view is hit it goes to a different Controller. So there is 1 Controller to handle each GET request. I am trying to introduce the SimpleFormController. However, my question is, since SFC handles GET and PUT - how can the controller succeeding this one also be SFC? How can you have 2 successive dynamic views with both SFC? Since the second form is displayed using the 1st SFC, the 2nd SFC will not handle the GET request? (Hope I am making sense)

Also in this case, is it correct to use 2 SimpleFC for consecutive dynamic GET requests? I am not very familiar about when to use SFC - would really appreciate it if someone can explain it to me.

Thanks in advance.
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to help, but I can't understand what you are trying to ask?

SimpleFormController makes it easy to bind a POJO to a form when displaying it (so, it is filled with some initial values), to accept a form submission into a POJO (i.e. binding submitted values to the POJO properties), and to show field level validation errors.
So, if you need those things, consider using a form controller.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic