Tutorial: Using Struts tags, action forms, and validation

In this tutorial, you learn how to use Struts tags, action forms, and validation in the context of WebSphere Commerce store development. In this tutorial, you replace the default Madisons starter store Contact Us page. The new Contact Us page contains a form to submit comments, and validate that the fields are completed before you submit the form.

Note: The steps in this tutorial are specific to the Madison Starter Store and may need to be modified for your storefront.

Learning objectives

After completing this tutorial, you should be familiar with the following concepts:
  • Struts
  • Action forms
  • Validation
  • JSPs
  • Controller commands
After completing this tutorial, you should be familiar with the following tasks:
  • Creating HTML forms
  • Creating dynamic action forms
  • Changing the implementation of a view
  • Adding validation
  • Adding messages to a store as a struts

Time required

Expect this tutorial to take 2 hours to complete. The tutorial takes longer if you explore concepts that are related to this tutorial.

Skill level

This tutorial is intended for WebSphere Commerce Store developers responsible for customizing the store appearance and enhancing store features. To complete this tutorial, you should be familiar with the following terms and concepts:
  • Java programming language.
  • JSP pages, including JSTL.
  • Struts.

System requirements

Before beginning this tutorial, ensure that you complete the following:
  • Install WebSphere Commerce Developer version 7.
  • Publish the Madisons starter store archive.
  • Enable Struts Development in WebSphere Commerce Developer, if it is disabled:
    1. Select Window > Preferences.
    2. Select General > Capabilities.
    3. Click Advanced... and select Web Developer (advanced) > Struts Development, if it is disabled.

      Selecting Struts Development

    4. Click OK to accept your changes and close the Advanced Capabilities Settings window.
    5. Click OK to accept your changes and close the Preferences window.

Tutorial resources

Download the WC7StrutsSample.zip to a temporary directory. This file contains the starting point for this programming tutorial.