Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

SimpleFormControllers in Spring MVC

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!