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:
- In the Project Navigator of the Web perspective, right-click the name of a project or any resource within the project.
- Left-click New > Other > Web > Struts > Action Mapping
- On the New Action Mapping page, complete the following steps:
- Specify the configuration file name or accept the default.
- Specify the action mapping path or accept the default.
- 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.
- 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
- 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.
- Click Finish.
Related concepts
Struts development tools
Struts actions
Related tasks
Creating a Struts action
Creating a Struts form bean
Feedback