posted 1 year ago
Hello Friends,
I am learning Spring MVC and I am unable to understand the difference between two examples.
1st example uses html form(helloWorld-form.jsp, helloWorld.jsp) while the 2nd example uses spring form(student-form.jsp, student-confirmation.jsp).
The corresponding HelloWorldController has two methods namely showForm and processFormVersion3 while the StudentController has methods showForm and processForm.
My questions are:
1. What is the advantage of using spring form over html form?
2. Why in the HelloWorldController the model's setAttribute is called in the processFormVersion3 method while in the StudentController it is called in the showForm method? When exactly should the model's setAttribute method be called?
3. In the StudentController' showForm method, what is the point of adding an empty Student object in the model?
1. helloWorld-form.jsp
2. student-form.jsp
3. helloWorld.jsp
4. student-confirmation.jsp
5. HelloWorldController
6. StudentController