The standard version of ActionServlet is configured based on the following servlet initialization parameters, which you will specify in the web application deployment descriptor (/WEB-INF/web.xml) for your application. Subclasses that specialize this servlet are free to define additional initialization parameters. Several of these were deprecated between the 1.0 and 1.1 releases. The deprecated parameters are listed after the nominal parameters.
标准ActionServlet在web.xml的初始化参数如下所示。
• config - Comma-separated list of context-relative path(s) to the XML resource(s) containing the configuration information for the default module. (Multiple files support since Struts 1.1) [/WEB-INF/struts-config.xml]. 指定strut配置信息文件
•
• config/${module} - Comma-separated list of Context-relative path(s) to the XML resource(s) containing the configuration information for the module that will use the specified prefix (/${module}). This can be repeated as many times as required for multiple modules. (Since Struts 1.1) 指定strut子模块配置信息文件
• convertNull - Force simulation of the Struts 1.0 behavior when populating forms. If set to true, the numeric Java wrapper class types (like java.lang.Integer) will default to null (rather than 0). (Since Struts 1.1) [false]
• rulesets - Comma-delimited list of fully qualified classnames of additional org.apache.commons.digester.RuleSet instances that should be added to the Digester that will be processing struts-config.xml files. By default, only the RuleSet for the standard configuration elements is loaded. (Since Struts 1.1)
• validating - Should we use a validating XML parser to process the configuration file (strongly recommended)? [true]
The following parameters may still be used with the Struts 1.1 release but are deprecated. 以下参数不建议使用
• application - Java class name of the application resources bundle base class. [NONE] DEPRECATED - Configure this using the "parameter" attribute of the <message-resources> element.
• bufferSize - The size of the input buffer used when processing file uploads. [4096] DEPRECATED - Configure this using the "bufferSize" attribute of the <controller> element.
• content - Default content type and character encoding to be set on each response; may be overridden by a forwarded-to servlet or JSP page. [text/html] DEPRECATED - Configure this using the "contentType" attribute of the <controller> element.
• debug - TThe debugging detail level that controls how much information is logged for this servlet. Accepts values 0 (off) and from 1 (least serious) through 6 (most serious). [0] DEPRECATED - Configure the logging detail level in your underlying logging implementation.
• factory - The Java class name of the MessageResourcesFactory used to create the application MessageResources object. [org.apache.struts.util.PropertyMessageResourcesFactory] DEPRECATED - Configure this using the "factory" attribute of the <message-resources> element.
• formBean - The Java class name of the ActionFormBean implementation to use [org.apache.struts.action.ActionFormBean]. DEPRECATED - Configure this using the "className" attribute of each <form-bean> element.
• forward - The Java class name of the ActionForward implementation to use [org.apache.struts.action.ActionForward]. Two convenient classes you may wish to use are:
o org.apache.struts.action.ForwardingActionForward - Subclass of org.apache.struts.action.ActionForward that defaults the redirect property to false (same as the ActionForward default value).
o org.apache.struts.action.RedirectingActionForward - Subclass of org.apache.struts.action.ActionForward that defaults the redirect property to true.
DEPRECATED - Configure this using the "className" attribute of each <forward> element.
• locale - If set to true, and there is a user session, identify and store an appropriate java.util.Locale object (under the standard key identified by Globals.LOCALE_KEY) in the user's session if there is not a Locale object there already. [true] DEPRECATED - Configure this using the "locale" attribute of the <controller> element.
• mapping - The Java class name of the ActionMapping implementation to use [org.apache.struts.action.ActionMapping]. Two convenient classes you may wish to use are:
o org.apache.struts.action.RequestActionMapping - Subclass of org.apache.struts.action.ActionMapping that defaults the scope property to "request".
o org.apache.struts.action.SessionActionMapping - Subclass of org.apache.struts.action.ActionMapping that defaults the scope property to "session". (Same as the ActionMapping default value).
DEPRECATED - Configure this using the "className" attribute of each <action> element, or globally for a module by using the "type" attribute of the <action-mappings> element.
• 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] DEPRECATED - Configure this using the "maxFileSize" attribute of the <controller> element.
• multipartClass - The fully qualified name of the MultipartRequestHandler implementation class to be used for processing file uploads. If set to none, disables Struts multipart request handling. [org.apache.struts.upload.CommonsMultipartRequestHandler] DEPRECATED - Configure this using the "multipartClass" attribute of the <controller> element.
• nocache - If set to true, add HTTP headers to every response intended to defeat browser caching of any response we generate or forward to. [false] DEPRECATED - Configure this using the "nocache" attribute of the <controller> element.
• null - If set to true, set our application resources to return null if an unknown message key is used. Otherwise, an error message including the offending message key will be returned. [true] DEPRECATED - Configure this using the "null" attribute of the <message-resources> element.
• tempDir - The temporary working directory to use when processing file uploads. [The working directory provided to this web application as a servlet context attribute] DEPRECATED - Configure this using the "tempDir" attribute of the <controller> element.
评论