Tutorials > Program model > Use Struts tags, action forms, and validation

< Previous | Next >


Create a dynamic action form

In this step, we will create a dynamic action form to hold the HTML form data in MyContactUsDisplay.jsp.


Procedure

  1. The struts-config-ext.xml file should still be open for editing in the Struts Configuration File editor. If not, navigate to Stores > WebContent, right-click the struts-config-ext.xml file, and select Open With > Struts Configuration File Editor.

  2. Click the Form Beans tab. In the Form Beans section, click Add to create a new Form Bean. Replace the bean name with MyContactUsForm.

  3. In the right column, browse to or enter org.apache.struts.action.DynaActionForm as the Type.

  4. From the top of the current Form Beans page, click Form Properties.

  5. In the DynaBeans section, select MyContactUsForm.

  6. Create Form properties by clicking Add in the Form Properties section.

    1. Enter name as the name of the new form property.

    2. While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.

    3. Enter email as the name of the new form property.

    4. While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.

    5. Enter comment as the name of the new form property.

    6. While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.

    7. Enter storeId as the name of the new form property.

    8. While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.

    9. Enter langId as the name of the new form property.

    10. While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.

    11. Enter catalogId as the name of the new form property.

    12. While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.

  7. Save the struts-config-ext.xml file (Ctrl + S).

< Previous | Next >


+

Search Tips   |   Advanced Search