Tutorials > Program model > Use Struts tags, action forms, and validation
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
- 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 Form Beans tab. In the Form Beans section, click Add to create a new Form Bean. Replace the bean name with MyContactUsForm.
- In the right column, browse to or enter org.apache.struts.action.DynaActionForm as the Type.
- From the top of the current Form Beans page, click Form Properties.
- In the DynaBeans section, select MyContactUsForm.
- Create Form properties by clicking Add in the Form Properties section.
- Enter name as the name of the new form property.
- While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.
- Enter email as the name of the new form property.
- While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.
- Enter comment as the name of the new form property.
- While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.
- Enter storeId as the name of the new form property.
- While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.
- Enter langId as the name of the new form property.
- While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.
- Enter catalogId as the name of the new form property.
- While still highlighting the new name property, browse to or enter java.lang.String as its Type in the Form Property Attributes section.
- Save the struts-config-ext.xml file (Ctrl + S).