Struts form beans and form-bean mappings

A form bean is a type of Java bean. A form bean is an instance of a subclass of an ActionForm class, which stores HTML form data from a submitted client request or that can store input data from a Struts action link that a user clicked. An HTML form comprises fields in which the user can enter information.

A form-bean mapping is an entry in a Struts configuration file that maps a form bean to an action.

When a browser submits an HTML form, the Struts action servlet does as follows:

  1. Looks at the field names from the HTML form

  2. Matches them to the properties' names in the form bean

  3. Automatically calls the set methods of these variables to put the values retrieved from the HTML form

In addition, if you implement a validate method and set the validate flag in the corresponding action mapping entry in the Struts configuration file, the action servlet invokes the validate method to validate that the data that the servlet receives is of the appropriate type.

 

Related concepts

Struts development tools
Struts actions
Web diagrams and the Web diagram editor
Struts configuration files

 

Related tasks

Creating Struts form beans
Creating Struts form-bean mappings

Related reference
Resolution rules for realizing Web diagram parts
Struts preferences for Web diagram editor
Web diagram editor: pop-up menu

Feedback