Flux - The Smart Struts Config Generator
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.
attribute | Name 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 Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
Try to avoid. |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
className | The 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 Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
Try to avoid. |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
forward | Module-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 Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | No |
Yes | No |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
include | Module-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 Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
input | Module-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 Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | Yes |
Yes | Yes |
None | If 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 PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
name | Name of the form bean, if any, that is associated with this
action mapping.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | Yes |
Yes | Yes |
None | None |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see AA |
see AA | see AA |
see AA | see AA |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
path | The module-relative path of the submitted
request, starting with a "/" character, and without the filename extension
(usually *.do) if extension mapping is used.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
parameter | General-purpose configuration parameter that can be used to
pass extra information to the Action object selected by
this action mapping.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | Yes |
Yes | Yes |
None | None |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see AA |
see AA | see AA |
see AA | see AA |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
prefix | Prefix used to match request parameter names to ActionForm
property names, if any. Optional if "name" is specified,
else not allowed.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
Try to avoid. |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
roles | Comma-delimited list of security role names that are allowed
access to this ActionMapping object. Since Struts 1.1.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
scope | The context ("request" or "session") that is used to
access our ActionForm bean, if any. Optional if "name" is
specified, else not valid.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
suffix | Suffix used to match request parameter names to ActionForm
bean property names, if any. Optional if "name" is
specified, else not valid.
Mapping Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
Try to avoid. |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
type | Fully 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 Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | No |
Yes | No |
None | Change the generated default
if you can re-use an existing class. |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see AA |
see AA | see AA |
see AA | see AA |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
unknown | Set 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 Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
Try to avoid. |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see PE |
|
validate | Set 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 Type | Add | Change |
Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
Page States (PS) | see PE |
see PE | see PE |
see PE | see PE |
Final State (FS) | see PE |
see PE | see PE |
see PE | see 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):
className | Fully qualified Java class name of ActionForward
subclass to use for this object.
["org.apache.struts.action.ActionForward"]
Mapping Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | Yes |
Yes | Yes | None |
Try to avoid. |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
|
contextRelative | Set 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 Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
|
name | The 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 Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
|
path | The 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 Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | No |
Yes | No | You may only change it by appending query parameters
following a '?'.
No other changes are allowed. |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | see PE |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see PE |
|
redirect | Set 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 Type | Add | Change | Delete | Constraints | Recommendations |
Page Events (PE) | No |
No | No | None |
None |
Action Activities (AA) | see PE |
see PE | see PE |
see PE | None |
Module Activities (MA) | see PE |
see PE | see PE |
see PE | see PE |
Page Preprocessings (PP) | see PE |
see PE | see PE |
see PE | see 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.