| This Chapter | |
| - | Chapter 4: Input Validation and Data Conversion |
| - | Data Types for Your Action Form’s Properties |
| - | Input Validation and Data Conversion Example |
| - | Using BeanUtils |
| - | Efficient Conversion |
| - | Summary |
As you have learned in Chapter 2, the action form’s main reason for existence is to help Struts programmers with user input validation. This chapter takes a closer look at input validation and deals with data conversion, a task that almost always precedes input validation. This chapter starts with a discussion of how to choose data types for your action form’s properties, so that smooth data conversion can be achieved in both Struts’ internals and in action objects. Three examples are then presented and the open source utility class BeanUtils, which is part of the Jakarta Commons project, is discussed.
Note
Chapter 5 covers the Validator plug-in, which helps you validate user input without Java code.