O'Reilly logo

Spring MVC: A Tutorial by Paul Deck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7

Validators

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 Springs own validation framework or by utilizing a JSR 303 implementation. This chapter covers both methods of input validation.

Validation Overview

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 this. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required