Configuring an existing action to use a Struts action class

In this lesson, you configure the TopCategoriesDisplay action. The action is responsible for invoking the main page of your starter store to use your new com.ibm.commerce.sample.struts.MyNewAction extended Struts action class. By default, all WebSphere Commerce actions use the com.ibm.commerce.struts.BaseAction class as their implementation class. These changes affect all of your stores that use the TopCategoriesDisplay action.

Procedure

  1. In the Enterprise Explorer view, navigate to Stores > WebContent > WEB-INF.
  2. Right-click the struts-config-ext.xml file; then click Open With > Struts Configuration File Editor.
  3. Click the Action Mappings tab, replace the current values in the tab with the following mappings:
    1. In the Actions Mappings section, locate the /TopCategoriesDisplay entry and highlight it.
    2. In the Action Mapping attributes section, click the Browse button next to the Type field. Enter MyNewAction in the field; select the MyNewAction class from the com.ibm.commerce.sample.struts package and click OK.
  4. Save your changes and close the editor.