Input validation is one of the most important web development tasks that Spring handles extremely well. There are two ways you can validate input in Spring MVC, by using Spring’s own validation framework or by utilizing a JSR 303 implementation. This chapter covers both methods of input validation.
Converters and formatters work on the field level. In an MVC application, they convert or format a String to another Java type, such as a java.util.Date. A validator, on the other hand, works on the object level. It determines whether or not all fields in an object are valid and some rules are followed.
The sequence of events in an application that employs both formatters and validators goes like ...