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

< Previous | Next >


Review the replacement Contact Us JSP page featuring a form

In this step, you review a new JSP page, called MyContactUsDisplay.jsp, which is designed to replace the default Contact Us page of the consumer direct sample store, ContactDisplay.jsp. Its main distinguishing feature is an HTML form, which collects user input to be processed by the back-end logic you enabled in the previous step.


Procedure

  1. In the Project Navigator view, navigate to the Stores > WebContent > ConsumerDirect_name > StoreInfoArea directory.

  2. Open MyContactUsDisplay.jsp for editing.

  3. Switch to the Source view of the editor.

  4. Examine the code and notice the following:

    • The main element of the new page is a form, defined with the Struts html:form tag.

    • The action attribute of the html:form element specifies the action to which the form will be submitted. The action is identified by the path attribute of its action configuration element. As we will see in Associate the action form with an action, the action element can also be used to establish the appropriate action form and scope for the HTML form.

    • The form comprises two text input fields, one text-area input field, and a submit button, rendered by means of Struts html:text, html:textarea, and html:submit tags, respectively.

    • The form also includes three hidden fields, defined by means of Struts html:hidden tag, which are used to pass along WebSphere Commerce context parameters.

< Previous | Next >


+

Search Tips   |   Advanced Search