7. Opening the Struts Configuration

In this section, you will open the Struts configuration used by the project. You will use the Struts Outline View and the Struts Configuration Editor to view and modify the Struts configuration.

Background

Workshop provides Struts configuration file Source and Design editors. In addition, a Struts configuration file Compound editor combines the benefits of both editors' capabilities. Changes in the Design editor automatically update the Source editor and vice versa. The Compound editor also synchronizes the selection between the Design and Source editors. Of course, all of the other benefits of the environment, including the Smart Editors, the Design Palette and the Property Sheet are also extended for use with the Struts Configuration editor as well.

Activating the Struts configuration file editor

  1. In the Project Explorer, expand the WEB-INF folder.
  2. Double-click on struts-config.xml to open this configuration file for editing.
  3. By default the Compound editor is activated. (Notice that the Struts Config tab is selected.)

  4. Click on the Source tab to activate the Source editor.
  5. Click on the Navigation tab to activate the Navigation editor.
  6. Click on the Struts Config tab to activate the Struts Config form editor.

Using the Struts outline view

  1. In the Outline view, expand Form Beans to show the list of the Struts form beans defined in this configuration file.
  2. Select logonForm. Notice that the logonForm properties are loaded in the Struts Config view.
  3. Expand Action Mappings to view all the actions defined in this configuration file.
  4. Select the /checkoutShipping action to highlight the corresponding source elements.

Using the Compound editor

  1. Click on the Struts Config tab at the bottom of the Struts editor.
  2. In the Struts Config view, expand the Action Mappings node and select the payment forward underneath the /checkoutShipping action in the graph, as shown below.

  3. Note that the source code now shows where this is defined.

  4. In the Struts Config view, change the value of the Name field under the Forward Properties panel to read "payments" and the press Enter.
  5. Note that the forward name changes to payments in the Navigation and Source views.

  6. In the Source view, change the forward name payments back to payment.
    Note that the forward name changes into payment in the Navigation view as well.

Click one of the following arrows to navigate through the tutorial:


Still need help? Post a question on the Workshop newsgroup.