Struts modules

A Struts module is a Struts configuration file and a set of corresponding actions, form beans, and Web pages. A Struts application consists of one module by default but may contain more than one module. Modules are new in Version 1.1 of the Struts standard.

Modules are configured in the web.xml file. Modules names are used in the URI prefixes for the action mappings in the module.

The first module that you create in a Struts-based Web application has no module name and is the default module. The default module has one or more configuration files. If you create a Struts 1.1 Web application with more than one module, each additional module has a name and exactly one configuration file.

Each module except the default module has a name that is specified in a param-name tag in the Web deployment descriptor (web.xml) file. The following code in the web.xml file specifies the Struts configuration file for the default module and for module mod1:

<init-param>
    <param-name>config</param-name>
    <param-value>WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
    <param-name>config/mod1</param-name>
    <param-value>WEB-INF/mod1-config.xml</param-value>
</init-param> 

 

Related concepts

Struts configuration files
The Web deployment descriptor editor

 

Related tasks

Creating Struts modules
Changing module association
Creating Struts configuration files

Related reference
Icons used by the Struts Explorer view
Resolution rules for realizing Web diagram parts
Web diagram editor: pop-up menu

Feedback