A form bean is a type of Java™ bean that stores HTML form data from
a submitted client request or stores input data from a Struts action link
that a user clicked.
- Hover over the /computeDay action and click
the Form bean icon.
- The Form bean selection window opens.
- Click New. The New Form-Bean wizard
opens.
- In the Form Bean Name field, type dateData,
then click Next.
- On the Choose new fields for your ActionForm class page,
select the DayOfWeek check box and click Next.
- On the Create new fields for your ActionForm class page,
add the following fields using the Add button:
| Option |
Description |
| Name |
Type |
| year |
int |
| month |
int |
| day |
int |
| dayOfWeek |
String |
- Click Next.
- On the Create a mapping for your ActionForm class page
in the Java package field type com.ibm.dayofweek.
- Click Finish.
- In the Form Bean Selection window, click
the dateData form bean you just created, then click OK.
The form bean dateData is added to the computeDay node and the actual
resource dateData.java is created in your Web project folder. Navigate to to see
the file.
At the end of this lesson, the Project Explorer should resemble:
