Struts2 struts. xml dtd description

Source: Internet
Author: User
Tags cdata

From: http://blog.csdn.net/cuixiuqin1954/article/details/4228741

 

For the core configuration file struts. XML in struts2, describe its DTD (Document Type Definition) file.

<? XML version = "1.0" encoding = "UTF-8"?> <! -- Start snippet: strutsdtd --> <! -- Struts configuration DTD. Use the following doctype <! Doctype struts public "-// Apache Software Foundation // DTD struts configuration 2.0 // en" "http://struts.apache.org/dtds/struts-2.0.dtd"> --> <! Element struts (package | include | bean | constant) *> <! -- The following labels can appear under the struts tag 0 or multiple times: organize multiple actions into one package. Include: contains a configuration file to separate the configuration file. BEAN: objects created by the container framework and injected into the framework. It is mainly used to associate third-party class libraries, such as spring. Generally, applications do not need to be configured. Contant: used to set the running environment of struts2. The effect is equivalent to configuring in struts. properties, or configuring init Param of filterdispatcher in Web. xml --> <! Element package (result-types ?, Interceptors ?, Default-interceptor-ref ?, Default-action-ref ?, Global-results ?, Global-exception-mappings ?, Action *)> <! -- The following label 0 or 1 result-types can appear under the package label: used to define the result type interceptors: used to define the interceptor default-interceptor-Ref: used to define the default interceptor for the package, all actions in this package (if this action does not set its own interceptor) will call the default interceptor default-action-Ref: the default actionglobal-results used by this package: set the commonly used result for this package and apply global-exception-mappings to all actions in this package: Define the commonly used result for this package when an exception occurs, the result used must be combined with global-results to display the following 0 or multiple actions under the package Tag: define action information for this package. --> <! ATTLIST package name CDATA # required extends CDATA # implied namespace CDATA # implied abstract CDATA # implied externalreferenceresolver nmtoken # implied> <! -- The Package label must contain the following attribute name: for this package, defining a unique identifier for the package label can contain the following attributes (or not) extends: the package inherits the packagenamespace: the namespace of this package (all the results and actions under it will add the configured namespace after rootcontext). If this parameter is not set, the default value is rootcontext. Abstract: this package is set to abstract, and action cannot exist in the abstract package. The value of this attribute is true or false. The default value is falseexternalreferenceresolver: used to integrate third-party class libraries, such as spring --> <! Element result-types (result-type +)> <! -- The result-type label must appear under the result-types label once or multiple times result-type: used to define a result type --> <! Element result-type (Param *)> <! -- The param label can appear under the result-type label 0 times or multiple times to define the parameters required for this result type --> <! ATTLIST result-type name CDATA # required class CDATA # required default (true | false) "false"> <! -- The result-type label must contain the following property name: Used to uniquely identify the result type class: the location of the result type Java class default: whether to set it to the default result type, the default value is false (not set to the default result type ). If it is set to the default result type, this result type is used by default if no type is specified for a result. --> <! Element interceptors (interceptor | Interceptor-stack) +> <! -- Under the interceptors tag, the following tag must appear once or multiple times (either or simultaneously) interceptor: used to define an interceptor Interceptor-Stack: used to define an interceptor Stack --> <! Element Interceptor (Param *)> <! -- The interceptor label can contain the param label 0 times or multiple times: used to set the parameters required by this interceptor --> <! ATTLIST interceptor name CDATA # required class CDATA # required> <! -- Interceptor must contain the following attribute name: Used to uniquely identify the interceptor class: used to specify the location of the interceptor Java class --> <! Element Interceptor-stack (Interceptor-ref +)> <! -- The Interceptor-stack tag must contain the Interceptor-ref tag once or multiple times. Interceptor-Ref: Specifies the Interceptor Used by the interceptor stack. --> <! ATTLIST Interceptor-stack name CDATA # required> <! -- Interceptor-the stack tag must contain the name attribute to uniquely identify the interceptor Stack --> <! Element Interceptor-ref (Param *)> <! -- The Interceptor-ref label can appear 0 times or multiple times, which is used to set the parameters required when the interceptor is used. --> <! ATTLIST Interceptor-ref name CDATA # required> <! The -- Interceptor-ref tag must contain the name attribute to specify the name of the interceptor or stack to be used. --> <! Element default-interceptor-ref (Param *)> <! -- The default-interceptor-ref label can appear 0 times or multiple times, which is used to set the parameters required to use the default interceptor. --> <! ATTLIST default-interceptor-ref name CDATA # required> <! -- The default-interceptor-ref tag must contain the name attribute, which is used to specify the default interceptor name or the name of the interceptor stack. --> <! Element default-action-ref (Param *)> <! -- The default-action-ref tag can appear 0 or multiple times under the param tag, which is used to set the parameters required to use the default action. --> <! ATTLIST default-action-ref name CDATA # required> <! -- The default-action-ref tag must contain the name attribute to specify the default action name. --> <! Element global-results (result +)> <! -- The result label must appear once or multiple times under the global-Results label to set the common result --> <! Element global-exception-mappings (exception-mapping +)> <! -- The exception-mapping label must appear once or multiple times under the global-exception-mappings label to specify a common one. When an exception occurs, the referenced result --> <! Element Action (Param | result | Interceptor-ref | exception-mapping) *> <! -- Under the Action tag, the following tag can appear 0 or multiple times. Param: used to set the result parameter used to call the next action: Define the result for this action (which can be a JSP or an action) interceptor-Ref: exception-mapping set for this action: defined for this action. If an exception occurs, the result --> <! ATTLIST action name CDATA # required class CDATA # implied method CDATA # implied converter CDATA # implied> <! -- The Action tag must contain the following attributes: Name uniquely identifies this actionclass: the location of the Java class used to specify the next action. The action tag can contain the following attributes: this action specifies the method to be called. If it is not specified, the execute method converter is called by default. If it is not specified, the default converter is used. --> <! Element param (# pcdata)> <! ATTLIST Param name CDATA # required> <! -- The param label must contain the name attribute --> <! Element result (# pcdata | PARAM) *> <! -- The param label can appear 0 times or multiple times under the result tag --> <! ATTLIST result name CDATA # implied type CDATA # implied> <! -- The result tag can contain the following property name: used to identify the resulttype: result type --> <! Element exception-mapping (# pcdata | PARAM) *> <! -- Exception-the param tag can appear 0 times or multiple times under the mapping tag --> <! ATTLIST exception-mapping name CDATA # implied exception CDATA # Required result CDATA # required> <! -- The exception-mapping tag can contain the following attribute name: used to identify this exception-mappingexception-mapping tag must contain the following attribute exception: Type of the exception that occurs result: result --> <! Element include (# pcdata)> <! ATTLIST include file CDATA # required> <! The -- include tag must contain the file attribute to specify the location of the file to be included. --> <! Element Bean (# pcdata)> <! ATTLIST bean type CDATA # implied name CDATA # implied class CDATA # required scope CDATA # implied static CDATA # implied optional CDATA # implied> <! Element constant (# pcdata)> <! ATTLIST constant name CDATA # required value CDATA # required> <! -- The constant label must contain the following attribute name: specify the key value of the constant: specify the value of the constant --> <! -- End snippet: strutsdtd -->

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.