15.6.1 Realizing the editBean

In this section you will realize the userBean. Execute the following steps:

1. In the Web diagram, double-click EditBean form bean. This will bring up the New Form-Bean wizard.

Figure 15-29 New Form-Bean wizard

2. Leave the form bean name unchanged. Make sure that the Create an ActionForm class radio button is selected, and that Generic Form-bean Mapping is selected.

3. Click Next.

4. In the Choose new fields for your ActionForm class window, do not select any fields and click Next.

5. In the Create new fields for your ActionForm class window, you will add two fields:

a. Click Add. Enter the field's name username. Leave the field type as String.

b. Click Add again. Enter the field's name password and leave the field type as String.

6. The window will look like in Figure 15-30. Click Next.

Figure 15-30 Creating new fields for the ActionForm Bean

7. In the Creating a mapping for your ActionForm class window, uncheck all method stubs as shown Figure 15-31. These methods are not needed in this scenario.

Figure 15-31 Creating a mapping

8. Click Finish to create the bean. Rational Application Developer will generate the ActionForm bean, that extends from rg.apache.struts.action.ActionForm, along with its proper methods. In addition, it will also include the required form-bean tag in the struts-config.xml file for Edit mode.

9. Save the file and close it.

Redbooks
ibm.com/redbooks