Skip to main content

Spring MVC Forms

Learn Spring MVC Forms (Form Handling, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Spring MVC form : the usual flow is GET shows an empty form backed by an object, POST receives the filled object, validates it and either shows errors or redirects. Pieces : a form class, a GET handler that adds it to the model, a POST handler with @Valid and BindingResult , and a template that shows fields and errors. Views : Thymeleaf uses th:object and th:field ; JSP uses the Spring tag library <form:form modelAttribute="user"> .

More lessons in Form Handling