Previous Next vertical dots separating previous/next from contents/index/pdf

Creating a new Struts action

Struts allows actions to be added to a Struts configuration in order to define the classes that will process user interactions coming from the Web browser. Actions are added as children of the action-mappings element in a Struts configuration, and are the centerpiece around which most Struts applications are built. Struts actions are associated with Struts action implementation classes and optionally with Struts form beans which can be used to pass data to the action. Workshop Studio and Workshop for Struts make it very easy to add Struts actions into your application.

Inserting an action using the Struts configuration form editor

  1. Open a Struts Configuration file using the Package Explorer.
  2. In the Struts Config view of the Struts, you will see the Struts configuration form editor, you will see the list of Struts artifacts including the current list of Action Mappings. You can expand it by clicking the plus sign (+) if it is collapsed.
  3. Right-click the Action Mapping node and select New Action Mapping.
  4. Enter the appropriate action properties through the resulting Action Mapping Tag dialog.
  5. Click Finish to insert the action into the opened Struts configuration file. The new action will appear under the list of Action Mappings and can be modified by selecting the specific action and updating the relevant properties.

Inserting an action from the Struts outline view

  1. Expand the Action Mappings node under the Struts Outline view.
  2. Select New Action Mapping from the pop-up menu on the Outline view. Note: The Outline view allows you to open the pop-up menu and select the action at the same time using a right-click.
  3. Enter action properties through the resulting Action Mapping Tag dialog.
  4. Click Finish to insert the action into the opened Struts configuration file.

Inserting an action from the Struts navigation editor

  1. To insert a action mapping from the Navigation tab
    1. Right-click anywhere in the white space of the Navigation view and select New Action Mapping from the pop-up menu.
    2. Enter the appropriate action properties through the resulting Action Mapping Tag dialog.
    3. Click Finish.

Related concepts

Struts
Struts Configuration

Related tasks
Adding global and local exceptions
Adding global and local forwards
Navigating with the Struts outline view
Working with Struts applications

Related reference

Insert Action Mapping
Struts User Guide

 

Skip navigation bar   Back to Top