Creating Struts action mappings

An action mapping is a Struts configuration file entry that associates an action name with an action. An action mapping can contain a reference to a form bean that the action can use, and can additionally define a list of local forwards that is visible only to this action.

To create an action mapping that associates a Struts action with a forward, complete the following steps:

  1. In the Project Navigator of the Web perspective, right-click the name of a project or any resource within the project.

  2. Left-click New > Other > Web > Struts > Action Mapping

  3. On the New Action Mapping page, complete the following steps:

    1. Specify the configuration file name or accept the default.

    2. Specify the action mapping path or accept the default.

    3. To specify a forward, click Add and specify the forward's name and path and, if the forward is context-relative, click the Context relative check box.

    4. If you want to use a form bean, select a form bean name from the Form Bean Name drop-down menu and select one of the following scopes from the Form Bean Scope drop-down menu:

      • request

      • session

    5. If you want to reuse an existing class for your mapping's type, click the An existing Action radio button and select a fully qualified class name from the drop-down menu. Otherwise, click the Create radio button and select Generic Action Mapping from the drop-down menu.

  4. Click Finish.

 

Related concepts

Struts development tools
Struts actions

 

Related tasks

Creating a Struts action
Creating a Struts form bean

Feedback