Home

This Chapter
-Chapter 2: Input Validation with Action Forms
-An Overview of Action Forms
-The ActionForm Class
-Using Action Forms
-Using HTML Tag Libraries
-Another Example
-Multipage Forms
-Dynamic Action Forms
-Summary

Table of Contents
-Introduction
-Chapter 1: Model 2 and Struts
-Chapter 2: Input Validation with Action Forms
-Chapter 3: The HTML Tag Library
-Chapter 4: Input Validation and Data Conversion
-Chapter 5: The Validator Plugin
-Chapter 6: The Expression Language
-Chapter 7: JSTL
-Chapter 8: The Bean Tag Library
-Chapter 9: The Logic Tag Library
-Chapter 10: Struts-EL, Nested, selectLabel
-Chapter 11: Message Handling and Internationalization
-Chapter 12: The Tiles Framework
-Chapter 13: Securing Struts Applications
-Chapter 14: The Config Object
-Chapter 15: The Persistence Layer
-Chapter 16: Object Caching
-Chapter 17: File Upload and File Download
-Chapter 18: Paging and Sorting
-Chapter 19: Preventing Double Submits
-Chapter 20: Early HttpSession Invalidation
-Chapter 21: Decorating Request Objects
-Chapter 22: How Struts Works

Previous
Next

 

Chapter 2

Input Validation with Action Forms

Input validation is an important task in Web application development. It includes checking if there is a value in a mandatory field, whether a date or a number was entered in the correct format, etc. Struts action forms make input validation easier and with them you can easily display error messages and redisplay a form’s previous field values without the need to resort to Java code.

This chapter focuses on how action forms help input validation in Struts. It first explains how the action form works, and then presents an example that demonstrates how powerful action forms can be. This chapter also introduces the HTML Tag Library for working with action forms, even though further details are discussed in Chapter 3. Furthermore, you can also find the discussion of error handling when working with action forms. In this respect, this chapter serves as an introduction to other topics of discussions: Struts validation in Chapter 4 and the Validator plug-in in Chapter 5.

Previous
Next