Entities - struts-config_1_2.dtd
DTD for the Struts Application Configuration File
To support validation of your configuration file, include the following DOCTYPE element at the beginning (after the "xml" declaration):
$Id: struts-config_1_2.dtd 55025 2004-10-18 17:40:29Z craigmcc $
<struts-config> | Root element |
The "struts-config" element is the root of the configuration file hierarchy, and contains nested elements for all of the other configuration settings.
Element's model :
<struts-config>'s children Name Cardinality action-mappings One or none controller One or none data-sources One or none description One or none display-name One or none form-beans One or none global-exceptions One or none global-forwards One or none message-resources Any number plug-in Any number
<struts-config>'s attributes Name Values Default id Match the ID rules.
(display-name?, description?, data-sources?, form-beans?, global-exceptions?, global-forwards?, action-mappings?, controller?, message-resources*, plug-in*)
@id | Attribute of struts-config |
Sorry, no documentation.
Possible values : Match the ID rules.
<data-sources> | Child of struts-config |
The "data-sources" element describes a set of DataSource objects [JDBC 2.0
Standard Extension]. The individual DataSource objects are configured through
nested
Element's model :
<data-sources>'s children Name Cardinality data-source Any number
<data-sources>'s attributes Name Values Default id Match the ID rules.
(data-source*)
@id | Attribute of data-sources |
Sorry, no documentation.
Possible values : Match the ID rules.
<data-source> | Child of data-sources |
The "data-source" element describes a DataSource object [JDBC 2.0 Standard Extension] that will be instantiated, configured, and made available as a servlet context attribute (or "application-scope bean"). Any object can be specified so long as it implements [javax.sql.DataSource] and can be configured entirely from JavaBean properties. The following attributes are required:
className The configuration bean for this DataSource object. If specified, the object must be a subclass of the default configuration bean. ["org.apache.struts.config.DataSourceConfig"]
key Servlet context attribute key under which this data source will be stored. Default is the value specified by string constant defined by Globals.DATA_SOURCE_KEY. The application module prefix (if any) is appended to the key (${key}$prefix}). [org.apache.struts.Globals.DATA_SOURCE_KEY]
NOTE: The application module prefix includes the leading slash, so the default datasource for a module named "foo" is stored under "org.apache.struts.action.DATA_SOURCE/foo".
type Fully qualified Java class name for this data source object. The class must implement DataSource [javax.sql.DataSource], and the object must be configurable entirely from JavaBean properties.
Element's model :
<data-source>'s children Name Cardinality set-property Any number
<data-source>'s attributes Name Values Default className id Match the ID rules. key type
(set-property*)
@id | Attribute of data-source |
Sorry, no documentation.
Possible values : Match the ID rules.
@className | Attribute of data-source |
Sorry, no documentation.
@key | Attribute of data-source |
Sorry, no documentation.
@type | Attribute of data-source |
Sorry, no documentation.
Required
<form-beans> | Child of struts-config |
The "form-beans" element describes the set of form bean descriptors for this module. The following attributes are defined:
type Fully qualified Java class to use when instantiating ActionFormBean objects. If specified, the object must be a subclass of the default class type.
WARNING: For Struts 1.0, this value is ignored. You can set the default implementation class name with the "formBean" initialization parameter to the Struts controller servlet.
Element's model :
<form-beans>'s children Name Cardinality form-bean Any number
<form-beans>'s attributes Name Values Default id Match the ID rules. type
(form-bean*)
@id | Attribute of form-beans |
Sorry, no documentation.
Possible values : Match the ID rules.
@type | Attribute of form-beans |
Sorry, no documentation.
<form-bean> | Child of form-beans |
The "form-bean" element describes an ActionForm subclass [org.apache.struts.action.ActionForm] that can be referenced by an "action" element.
The "form-bean" element describes a particular form bean, which is a JavaBean that implements the org.apache.struts.action.ActionForm class. The following attributes are defined:
className The configuration bean for this form bean object. If specified, the object must be a subclass of the default configuration bean. ["org.apache.struts.config.FormBeanConfig"]
name The unique identifier for this form bean. Referenced by the
type Fully qualified Java class name of the ActionForm subclass to use with this form bean.
Element's model :
<form-bean>'s children Name Cardinality description One or none display-name One or none form-property Any number icon One or none set-property Any number
<form-bean>'s attributes Name Values Default className dynamic true, false, yes, no id Match the ID rules. name type
(icon?, display-name?, description?, set-property*, form-property*)
@id | Attribute of form-bean |
Sorry, no documentation.
Possible values : Match the ID rules.
@className | Attribute of form-bean |
Sorry, no documentation.
@dynamic | Attribute of form-bean |
Sorry, no documentation.
Possible values : true, false, yes, no
@name | Attribute of form-bean |
Sorry, no documentation.
Required
@type | Attribute of form-bean |
Sorry, no documentation.
Required
<form-property> | Child of form-bean |
The "form-property" element describes a JavaBean property that can be used to
configure an instance of a DynaActionForm or a subclass thereof. This element
is only utilized when the "type" attribute of the enclosing "form-bean" element
is [org.apache.struts.action.DynaActionForm] or a subclass of DynaActionForm. If
a custom DynaActionForm subclass is used, then the "dynamic" attribute of the
enclosing
className The configuration bean for this form property object. If specified, the object must be a subclass of the default configuration bean. ["org.apache.struts.config.FormPropertyConfig"]
initial String representation of the initial value for this property. If not specified, primitives will be initialized to zero and objects initialized to the zero-argument instantiation of that object class. For example, Strings will be initialized to ""
name The name of the JavaBean property described by this element.
size The number of array elements to create if the value of the "type" attribute specifies an array, but there is no value specified for the "initial" attribute.
type Fully qualified Java class name of the field underlying this property, optionally followed by "[]" to indicate that the field is indexed.
Element's model :
<form-property>'s children Name Cardinality set-property Any number
<form-property>'s attributes Name Values Default className initial name size type
(set-property*)
@className | Attribute of form-property |
Sorry, no documentation.
@initial | Attribute of form-property |
Sorry, no documentation.
@name | Attribute of form-property |
Sorry, no documentation.
Required
@size | Attribute of form-property |
Sorry, no documentation.
@type | Attribute of form-property |
Sorry, no documentation.
Required
<global-exceptions> | Child of struts-config |
The "global-exceptions" element describes a set of exceptions that might be
thrown by an Action object. The handling of individual exception types is
configured through nested exception elements. An
Element's model :
<global-exceptions>'s children Name Cardinality exception Any number
<global-exceptions>'s attributes Name Values Default id Match the ID rules.
(exception*)
@id | Attribute of global-exceptions |
Sorry, no documentation.
Possible values : Match the ID rules.
<exception> | Child of global-exceptions,action |
The "exception" element registers an ExceptionHandler for an exception type. The following attributes are defined:
bundle Servlet context attribute for the message resources bundle associated with this handler. The default attribute is the value specified by the string constant declared at Globals.MESSAGES_KEY. [org.apache.struts.Globals.MESSAGES_KEY]
className The configuration bean for this ExceptionHandler object. If specified, className must be a subclass of the default configuration bean ["org.apache.struts.config.ExceptionConfig"]
handler Fully qualified Java class name for this exception handler. ["org.apache.struts.action.ExceptionHandler"]
key The key to use with this handler's message resource bundle that will retrieve the error message template for this exception.
path The module-relative URI to the resource that will complete the request/response if this exception occurs.
scope The context ("request" or "session") that is used to access the ActionError object [org.apache.struts.action.ActionError] for this exception.
type Fully qualified Java class name of the exception type to register with this handler.
Element's model :
<exception>'s children Name Cardinality description One or none display-name One or none icon One or none set-property Any number
<exception>'s attributes Name Values Default bundle className handler id Match the ID rules. key path scope type
(icon?, display-name?, description?, set-property*)
@id | Attribute of exception |
Sorry, no documentation.
Possible values : Match the ID rules.
@bundle | Attribute of exception |
Sorry, no documentation.
@className | Attribute of exception |
Sorry, no documentation.
@handler | Attribute of exception |
Sorry, no documentation.
@key | Attribute of exception |
Sorry, no documentation.
Required
@path | Attribute of exception |
Sorry, no documentation.
@scope | Attribute of exception |
Sorry, no documentation.
@type | Attribute of exception |
Sorry, no documentation.
Required
<global-forwards> | Child of struts-config |
The "global-forwards" element describes a set of ActionForward objects
[org.apache.struts.action.ActionForward] that are available to all Action
objects as a return value. The individual ActionForwards are configured
through nested
type Fully qualified Java class to use when instantiating ActionForward objects. If specified, the object must be a subclass of the default class type.
WARNING: For Struts 1.0, this value is ignored. You can set the default implementation class name with the "forward" initialization parameter to the Struts controller servlet.
Element's model :
<global-forwards>'s children Name Cardinality forward Any number
<global-forwards>'s attributes Name Values Default id Match the ID rules. type
(forward*)
@id | Attribute of global-forwards |
Sorry, no documentation.
Possible values : Match the ID rules.
@type | Attribute of global-forwards |
Sorry, no documentation.
<forward> | Child of action,global-forwards |
The "forward" element describes an ActionForward that is to be made
available to an Action as a return value. An ActionForward is referenced by
a logical name and encapsulates a URI. A "forward" element may be used to
describe both global and local ActionForwards. Global forwards are available
to all the Action objects in the module. Local forwards can be
nested within an
className Fully qualified Java class name of ActionForward subclass to use for this object. ["org.apache.struts.action.ActionForward"]
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. DEPRECATED. [false]
module The module prefix to use with this path. This value should begin with a slash ("/").
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.
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.
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]
Element's model :
<forward>'s children Name Cardinality description One or none display-name One or none icon One or none set-property Any number
<forward>'s attributes Name Values Default className contextRelative true, false, yes, no id Match the ID rules. module name path redirect true, false, yes, no
(icon?, display-name?, description?, set-property*)
@id | Attribute of forward |
Sorry, no documentation.
Possible values : Match the ID rules.
@className | Attribute of forward |
Sorry, no documentation.
@contextRelative | Attribute of forward |
Sorry, no documentation.
Possible values : true, false, yes, no
@module | Attribute of forward |
Sorry, no documentation.
@name | Attribute of forward |
Sorry, no documentation.
Required
@path | Attribute of forward |
Sorry, no documentation.
Required
@redirect | Attribute of forward |
Sorry, no documentation.
Possible values : true, false, yes, no
<action-mappings> | Child of struts-config |
The "action-mappings" element describes a set of ActionMapping objects
[org.apache.struts.action.ActionMapping] that are available to process
requests matching the url-pattern our ActionServlet registered with the
container. The individual ActionMappings are configured through nested
type Fully qualified Java class to use when instantiating ActionMapping objects. If specified, the object must be a subclass of the default class type.
WARNING: For Struts 1.0, this value is ignored. You can set the default implementation class name with the "mapping" initialization parameter to the Struts controller servlet.
Element's model :
<action-mappings>'s children Name Cardinality action Any number
<action-mappings>'s attributes Name Values Default id Match the ID rules. type
(action*)
@id | Attribute of action-mappings |
Sorry, no documentation.
Possible values : Match the ID rules.
@type | Attribute of action-mappings |
Sorry, no documentation.
<action> | Child of action-mappings |
The "action" element describes an ActionMapping object that is to be used to process a request for a specific module-relative URI. The following attributes are defined:
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.
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
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 module. Exactly one of "forward", "include", or "type" must be specified.
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 module. Exactly one of "forward", "include", or "type" must be specified.
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.
name Name of the form bean, if any, that is associated with this action mapping.
path The module-relative path of the submitted request, starting with a "/" character, and without the filename extension if extension mapping is used.
NOTE: Do *not* include a period in your path name, because it will look like a filename extension and cause your Action to not be located.
parameter General-purpose configuration parameter that can be used to pass extra information to the Action object selected by this action mapping.
prefix Prefix used to match request parameter names to ActionForm property names, if any. Optional if "name" is specified, else not allowed.
roles Comma-delimited list of security role names that are allowed access to this ActionMapping object. Since Struts 1.1.
scope The context ("request" or "session") that is used to access our ActionForm bean, if any. Optional if "name" is specified, else not valid. [session]
suffix Suffix used to match request parameter names to ActionForm bean property names, if any. Optional if "name" is specified, else not valid.
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.
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]
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]
Element's model :
<action>'s children Name Cardinality description One or none display-name One or none exception Any number forward Any number icon One or none set-property Any number
<action>'s attributes Name Values Default attribute className forward id Match the ID rules. include input name parameter path prefix roles scope request, session suffix type unknown true, false, yes, no validate true, false, yes, no
(icon?, display-name?, description?, set-property*, exception*, forward*)
@id | Attribute of action |
Sorry, no documentation.
Possible values : Match the ID rules.
@attribute | Attribute of action |
Sorry, no documentation.
@className | Attribute of action |
Sorry, no documentation.
@forward | Attribute of action |
Sorry, no documentation.
@include | Attribute of action |
Sorry, no documentation.
@input | Attribute of action |
Sorry, no documentation.
@name | Attribute of action |
Sorry, no documentation.
@parameter | Attribute of action |
Sorry, no documentation.
@path | Attribute of action |
Sorry, no documentation.
Required
@prefix | Attribute of action |
Sorry, no documentation.
@roles | Attribute of action |
Sorry, no documentation.
@scope | Attribute of action |
Sorry, no documentation.
Possible values : request, session
@suffix | Attribute of action |
Sorry, no documentation.
@type | Attribute of action |
Sorry, no documentation.
@unknown | Attribute of action |
Sorry, no documentation.
Possible values : true, false, yes, no
@validate | Attribute of action |
Sorry, no documentation.
Possible values : true, false, yes, no
<controller> | Child of struts-config |
The "controller" element describes the ControllerConfig bean [org.apache.struts.config.ControllerConfig] that encapsulates a module's runtime configuration. The following attributes are defined:
bufferSize The size of the input buffer used when processing file uploads. [4096]
className Fully qualified Java class name of the ControllerConfig subclass for this controller object. If specified, the object must be a subclass of the default class. ["org.apache.struts.config.ControllerConfig"]
contentType Default content type (and optional character encoding) to be set on each response. May be overridden by the Action, JSP, or other resource to which the request is forwarded. ["text/html"]
forwardPattern Replacement pattern defining how the "path" attribute of a
inputForward Set to "true" if you want the "input" attribute of
locale Set to "true" if you want a Locale object stored in the user's session if not already present. [true]
maxFileSize The maximum size (in bytes) of a file to be accepted as a file upload. Can be expressed as a number followed by a "K", "M", or "G", which are interpreted to mean kilobytes, megabytes, or gigabytes, respectively. ["250M"]
memFileSize The maximum size (in bytes) of a file whose contents will be retained in memory after uploading. Files larger than this threshold will be written to some alternative storage medium, typically a hard disk. Can be expressed as a number followed by a "K", "M", or "G", which are interpreted to mean kilobytes, megabytes, or gigabytes, respectively. ["256K"]
multipartClass The fully qualified Java class name of the multipart request handler class to be used with this module. ["org.apache.struts.upload.CommonsMultipartRequestHandler"]
nocache Set to "true" if you want the controller to add HTTP headers for defeating caching to every response from this module. [false]
pagePattern Replacement pattern defining how the "page" attribute of custom tags using it is mapped to a context-relative URL of the corresponding resource. This value may consist of any combination of the following: - "$M" - Replaced by the module prefix of this module - "$P" - Replaced by the value of the "page" attribute - "$$" - Causes a literal dollar sign to be rendered - "$x" - (Where "x" is any character not defined above) Silently swallowed, reserved for future use If not specified, the default forwardPattern is "$M$P", which is consistent with previous hard coded behavior of URL evaluation for "page" attributes. ["$M$P"]
processorClass The fully qualified Java class name of the RequestProcessor subclass to be used with this module. ["org.apache.struts.action.RequestProcessor"]
tempDir Temporary working directory to use when processing file uploads. [{Directory provided by servlet container}]
Element's model :
<controller>'s children Name Cardinality set-property Any number
<controller>'s attributes Name Values Default bufferSize className contentType forwardPattern id Match the ID rules. inputForward true, false, yes, no locale true, false, yes, no maxFileSize memFileSize multipartClass nocache true, false, yes, no pagePattern processorClass tempDir
(set-property*)
@id | Attribute of controller |
Sorry, no documentation.
Possible values : Match the ID rules.
@bufferSize | Attribute of controller |
Sorry, no documentation.
@className | Attribute of controller |
Sorry, no documentation.
@contentType | Attribute of controller |
Sorry, no documentation.
@forwardPattern | Attribute of controller |
Sorry, no documentation.
@inputForward | Attribute of controller |
Sorry, no documentation.
Possible values : true, false, yes, no
@locale | Attribute of controller |
Sorry, no documentation.
Possible values : true, false, yes, no
@maxFileSize | Attribute of controller |
Sorry, no documentation.
@memFileSize | Attribute of controller |
Sorry, no documentation.
@multipartClass | Attribute of controller |
Sorry, no documentation.
@nocache | Attribute of controller |
Sorry, no documentation.
Possible values : true, false, yes, no
@pagePattern | Attribute of controller |
Sorry, no documentation.
@processorClass | Attribute of controller |
Sorry, no documentation.
@tempDir | Attribute of controller |
Sorry, no documentation.
<message-resources> | Child of struts-config |
The "message-resources" element describes a MessageResources object with message templates for this module. The following attributes are defined:
className The configuration bean for this message resources object. If specified, the object must be a subclass of the default configuration bean. ["org.apache.struts.config.MessageResourcesConfig"]
factory Fully qualified Java class name of the MessageResourcesFactory subclass to use for this message resources object. ["org.apache.struts.util.PropertyMessageResourcesFactory"]
key Servlet context attribute under which this message resources bundle will be stored. The default attribute is the value specified by the string constant at [Globals.MESSAGES_KEY]. The module prefix (if any) is appended to the key (${key}${prefix}). [org.apache.struts.Globals.MESSAGES_KEY]
NOTE: The module prefix includes the leading slash, so the default message resource bundle for a module named "foo" is stored under "org.apache.struts.action.MESSAGE/foo".
null Set to "true" if you want our message resources to return a null string for unknown message keys, or "false" to return a message with the bad key value.
parameter Configuration parameter to be passed to the createResources method of our factory object.
Element's model :
<message-resources>'s children Name Cardinality set-property Any number
<message-resources>'s attributes Name Values Default className factory id Match the ID rules. key null true, false, yes, no parameter
(set-property*)
@id | Attribute of message-resources |
Sorry, no documentation.
Possible values : Match the ID rules.
@className | Attribute of message-resources |
Sorry, no documentation.
@factory | Attribute of message-resources |
Sorry, no documentation.
@key | Attribute of message-resources |
Sorry, no documentation.
@null | Attribute of message-resources |
Sorry, no documentation.
Possible values : true, false, yes, no
@parameter | Attribute of message-resources |
Sorry, no documentation.
Required
<plug-in> | Child of struts-config |
The "plug-in" element specifies the fully qualified class name of a
general-purpose application plug-in module that receives notification of
application startup and shutdown events. An instance of the specified class
is created for each element, and can be configured with nested
className Fully qualified Java class name of the plug-in class; must implement [org.apache.struts.action.PlugIn].
Element's model :
<plug-in>'s children Name Cardinality set-property Any number
<plug-in>'s attributes Name Values Default className id Match the ID rules.
(set-property*)
@id | Attribute of plug-in |
Sorry, no documentation.
Possible values : Match the ID rules.
@className | Attribute of plug-in |
Sorry, no documentation.
Required
<description> | Child of form-bean,action,forward,exception,struts-config |
The "description" element contains descriptive (paragraph length) text about the surrounding element, suitable for use in GUI tools.
<description>'s attributes Name Values Default id Match the ID rules.
@id | Attribute of description |
Sorry, no documentation.
Possible values : Match the ID rules.
<display-name> | Child of form-bean,action,forward,exception,struts-config |
The "display-name" element contains a short (one line) description of the surrounding element, suitable for use in GUI tools.
<display-name>'s attributes Name Values Default id Match the ID rules.
@id | Attribute of display-name |
Sorry, no documentation.
Possible values : Match the ID rules.
<icon> | Child of form-bean,action,forward,exception |
The "icon" element contains a small-icon and large-icon element which specify the location, relative to the Struts configuration file, for small and large images used to represent the surrounding element in GUI tools.
Element's model :
<icon>'s children Name Cardinality large-icon One or none small-icon One or none
<icon>'s attributes Name Values Default id Match the ID rules.
(small-icon?, large-icon?)
@id | Attribute of icon |
Sorry, no documentation.
Possible values : Match the ID rules.
<large-icon> | Child of icon |
The "large-icon" element specifies the location, relative to the Struts configuration file, of a resource containing a large (32x32 pixel) icon image.
<large-icon>'s attributes Name Values Default id Match the ID rules.
@id | Attribute of large-icon |
Sorry, no documentation.
Possible values : Match the ID rules.
<set-property/> | Child of plug-in,form-bean,data-source,action,form-property,forward,exception,message-resources,controller |
The "set-property" element specifies the method name and initial value of
an additional JavaBean configuration property. When the object representing
the surrounding element is instantiated, the accessor for the indicated
property is called and passed the indicated value. The "set-property"
element is especially useful when a custom subclass is used with
property Name of the JavaBeans property whose setter method will be called.
value String representation of the value to which this property will be set, after suitable type conversion
<set-property>'s attributes Name Values Default id Match the ID rules. property value
This element is always empty.
@id | Attribute of set-property |
Sorry, no documentation.
Possible values : Match the ID rules.
@property | Attribute of set-property |
Sorry, no documentation.
Required
@value | Attribute of set-property |
Sorry, no documentation.
Required
<small-icon> | Child of icon |
The "small-icon" element specifies the location, relative to the Struts configuration file, of a resource containing a small (16x16 pixel) icon image.
<small-icon>'s attributes Name Values Default id Match the ID rules.
@id | Attribute of small-icon |
Sorry, no documentation.
Possible values : Match the ID rules.