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

< Previous | Next >


Associate the action form with an action

In this step, we will create a dynamic action form for 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 Action Mappings tab. In the Action Mappings section, select MyContactUsCmd. This is the action you have specified in the Struts input form of MyContactUsDisplay.jsp.

  3. In the Form Bean Specification section:

    1. Enter the Form Bean Name by pressing Ctrl + Space to select MyContactUsForm.

    2. From the Scope list, select request.

    3. Ensure the Validate check box is not selected.

  4. Switch to the Source view and verify that the MyContactUsCmd action definition now looks...

    <action path="/MyContactUsCmd"
    type="com.ibm.commerce.struts.BaseAction" 
            parameter="com.ibm.commerce.sample.commands.MyContactUsCmd"
            name="MyContactUsForm" 
            scope="request"
            validate="false"> 
    </action>
    

  5. Save the changes, but leave the editor open.

< Previous | Next >


+

Search Tips   |   Advanced Search