Tutorials > Program model > Use Struts tags, action forms, and validation
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
- 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.
- 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.
- In the Form Bean Specification section:
- Enter the Form Bean Name by pressing Ctrl + Space to select MyContactUsForm.
- From the Scope list, select request.
- Ensure the Validate check box is not selected.
- 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>
- Save the changes, but leave the editor open.