Spring MVC form handling example

This tutorial shows you how to do form handling in Spring Web MVC application. Technologies and tools used: Java 11 Spring 5.2.22.RELEASE JSP JSTL 1.2 Embedded Jetty Server 9.4.45.v20220203 Servlet API 4.0.4 Bootstrap 5.2.0 (webjars) Hibernate Validator 6.2.5.Final HSQLDB 2.7.0 IntelliJ IDEA Maven 3.8.6 Spring Test 5.2.22.RELEASE Hamcrest 2.2 JUnit 5.9 Table of contents: 1. …

Read more

Spring MVC form errors tag example

In Spring MVC, the field error messages are generated by validators associated with the controller, and you can use the <form:errors /> tag to render those field error messages in an default HTML “span” tag. For example, 1. Validator A validator to check the “username” field, if empty, return the “required.username” error message from the …

Read more