O'Reilly logo

Struts 2 Design and Programming: A Tutorial by Budi Kurniawan

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 8. Input Validation

A robust web application must ensure that user input is valid. For instance, you may want to make sure that user information entered in a form will only be stored in the database if the selected password is at least n characters long and the birth date is a date that is no later than today’s date. Struts makes input validation easy by providing built-in validators that are based on the XWork Validation Framework. Using these validators does not require programming. Instead, you declare in an XML file how a validator should work. Among the things to declare are what field needs to be validated and what message to send to the browser if a validation fails.

In more complex scenarios, built-in validators can help little ...

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