Flux - The Smart Struts Config Generator

The Flux project
SourceForge.net Logo

Edit Rules

This reference describes what and how you may or may not edit in the struts-config-<module>.xml files generated by Flux. The general principle from which these rules are derived is that you may change the configuration in any way as long as it does not contradict the more abstract UML model.

Action Element Attributes

The following table lists all attributes an action element can possibly have. The blue descriptions of the attributes have been taken from the struts-config_1_1.dtd. For each type of action mapping that Flux can generate the inner table says if you may add the corresponding attribute, change its value or delete it and which constraints you must obeye when doing so.

attributeName of the request-scope or session-scope attribute that is used to access our ActionForm bean, if it is other than the bean's specified "name". Optional if "name" is specified, else not valid.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone Try to avoid.
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
classNameThe fully qualified Java class name of the ActionMapping subclass to use for this action mapping object. Defaults to the type specified by the enclosing <action-mappings> element or to "org.apache.struts.action.ActionMapping" if not specified. ["org.apache.struts.action.ActionMapping"]
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone Try to avoid.
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
forwardModule-relative path of the servlet or other resource that will process this request, instead of the Action class specified by "type". The path WILL NOT be processed through the "forwardPattern" attribute that is configured on the "controller" element for this application module. Exactly one of "forward", "include", or "type" must be specified.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)No YesNo see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
includeModule-relative path of the servlet or other resource that will process this request, instead of the Action class specified by "type". The path WILL NOT be processed through the "forwardPattern" attribute that is configured on the "controller" element for this application module. Exactly one of "forward", "include", or "type" must be specified.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
inputModule-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when "name" is specified. Required if "name" is specified and the input bean returns validation errors. Optional if "name" is specified and the input bean does not return validation errors.
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)Yes YesYes NoneIf you use it set the controller element's attribute "inputForward" to "true"
and use the name of a local forward child element as the input attribute's value.
That way this type of branch is covered by the UML model.
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
nameName of the form bean, if any, that is associated with this action mapping.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)Yes YesYes NoneNone
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see AA see AAsee AA see AAsee AA
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
pathThe module-relative path of the submitted request, starting with a "/" character, and without the filename extension (usually *.do) if extension mapping is used.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
parameterGeneral-purpose configuration parameter that can be used to pass extra information to the Action object selected by this action mapping.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)Yes YesYes NoneNone
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see AA see AAsee AA see AAsee AA
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
prefixPrefix used to match request parameter names to ActionForm property names, if any. Optional if "name" is specified, else not allowed.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone Try to avoid.
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
rolesComma-delimited list of security role names that are allowed access to this ActionMapping object. Since Struts 1.1.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
scopeThe context ("request" or "session") that is used to access our ActionForm bean, if any. Optional if "name" is specified, else not valid.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
suffixSuffix used to match request parameter names to ActionForm bean property names, if any. Optional if "name" is specified, else not valid.
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone Try to avoid.
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
typeFully qualified Java class name of the Action subclass [org.apache.struts.action.Action] that will process requests for this action mapping. Not valid if either the "forward" or "include" attribute is specified. Exactly one of "forward", "include", or "type" must be specified.
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)No YesNo NoneChange the generated default if you can re-use an existing class.
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see AA see AAsee AA see AAsee AA
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
unknownSet to "true" if this object should be configured as the default action mapping for this module. If a request does not match another object, it will be passed to the ActionMapping object with unknown set to "true". Only one ActionMapping can be marked as "unknown" within a module. [false]
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone Try to avoid.
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE
validateSet to "true" if the validate method of the ActionForm bean should be called prior to calling the Action object for this action mapping, or set to "false" if you do not want the validate method called. [true]
Mapping TypeAddChange DeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
Page States (PS)see PE see PEsee PE see PEsee PE
Final State (FS)see PE see PEsee PE see PEsee PE

Action Element Children

Forward Elements

Nested forward elements must not be added to or deleted from an action mapping. You may, however, add, change and delete nested elements of such generated forward elements (icon, display-name, description, set-property). You may also add, change or delete attributes of such generated forward elements as defined in the following table (the mapping types 'Page State' and 'Final State' are not listed in the inner tables because these types never have nested forward elements):

classNameFully qualified Java class name of ActionForward subclass to use for this object. ["org.apache.struts.action.ActionForward"]
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)Yes YesYesNone Try to avoid.
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
contextRelativeSet this to "true" if, in a modular application, the path attribute starts with a slash "/" and should be considered relative to the entire web application rather than the module. Since Struts 1.1. [false]
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
nameThe unique identifier for this forward. Referenced by the Action object at runtime to select - by its logical name - the resource that should complete the request/response.
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
pathThe module-relative or context-relative path to the resources that is encapsulated by the logical name of this ActionForward. If the path is to be considered context-relative when used in a modular application, then the contextRelative attribute should be set to "true". This value should begin with a slash ("/") character.
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)No YesNoYou may only change it by appending query parameters following a '?'.
No other changes are allowed.
None
Action Activities (AA)see PE see PEsee PE see PEsee PE
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE
redirectSet to "true" if a redirect instruction should be issued to the user-agent so that a new request is issued for this forward's resource. If true, RequestDispatcher.Redirect is called. If "false", RequestDispatcher.forward is called instead. [false]
Mapping TypeAddChangeDeleteConstraintsRecommendations
Page Events (PE)No NoNoNone None
Action Activities (AA)see PE see PEsee PE see PENone
Module Activities (MA)see PE see PEsee PE see PEsee PE
Page Preprocessings (PP)see PE see PEsee PE see PEsee PE

Other Child Elements

You can add, change and delete all other types of child elements an action element can have (icon, display-name, description, exception and set-property).

Other Parts of the Config File

Flux does not touch anything but the action elements between the opening and the closing <action-mappings> element. So you are free to arbitrarily modify all other parts of the struts-config-<module>.xml files (data-sources, form-beans, global-exceptions, global-forwards, controller, message-resources, plug-in).

You can also change the attributes of the collection tag <action-mappings> itself at will.

XML Comments

Don't add <!-- --> comments anywhere between the opening and the closing <action-mappings> element. They will not be preserved on re-generation. Comments in other parts of the file survive.

Order

The order of action mappings, nested elements and attributes is partially determined by Flux. It groups action mappings by type (Page Events, Action Activities, Module Activities, Page Preprocessings (optional), Page States, Final State, Non-modelled Action Mappings). Within each group action elements are ordered alphabetically by their path attribute. Nested forward elements are ordered by their name attribute.