29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Form bean mapping wizard<br />

To create a Struts form-bean mapping, complete the following steps:<br />

1. In the Project Navigator of the Web perspective, right-click the name of a<br />

project.<br />

2. Click New -> Other -> Web -> Struts -> Form-Bean Mapping -> Next.<br />

Note: There are three other ways to invoke the Form bean mapping wizard.<br />

– Double-clicking an unrealized form bean node in the Web diagram<br />

editor.<br />

– Expanding the project directory in the Struts Explorer view, right-clicking<br />

the module, and selecting New -> Form Bean from the context menu.<br />

– Expanding the module folder in the Struts Explorer view, right-clicking<br />

the Form Beans folder, and selecting Add Form Bean... from the<br />

context menu.<br />

3. On the New Form-Bean page, complete the following steps:<br />

a. Make sure that the correct configuration file name and mapping name are<br />

specified.<br />

b. Click one of the following radio buttons:<br />

An existing ActionForm<br />

Create an ActionForm class or Struts dynaform using DynaActionForm<br />

c. If you selected the second option in the previous step, you must select one<br />

of the following models from the drop-down menu:<br />

Generic Form-Bean Mapping<br />

dynaform using DynaActionForm<br />

d. Click Next.<br />

4. On the Choose new fields for your ActionForm class page, click the check box<br />

beside the name of each module for which you want a get and a set method<br />

created. Then click Next.<br />

5. On the Create new fields for your ActionForm class page, click Add and type<br />

the field name and type for each field you want to create. If you chose<br />

Generic Form-Bean Mapping, click Next; otherwise click Finish.<br />

6. On the Create a mapping for your ActionForm class page, click the Add new<br />

ActionForm class box and complete the following steps:<br />

a. Specify the name for the new ActionForm class.<br />

b. Specify the path name of the folder in which the class will be created, or<br />

accept the default.<br />

Chapter 12. Using Struts 413

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!