Deploy Descriptor (Web.xml) element --- [en ed]

xiaoxiao2021-03-06  71

Web.xml Deployment Descriptor Elements

This following sections describe the deployment descriptor elements defined in the web.xml file The root element for web.xml is The following elements are defined within the element..:

Icon Element

Display-Name Element Description Element Distributable Element Context-Param Element

Filter Element

FILTER-MAPPING ELEMENT

Listener Element

Servlet Element

servlet-mapping element

Session-Config Element

MIME-MAPPING ELEMENT

Welcome-file-list element

Error-Page Element

Taglib Element

Resource-Ref Element

Security-construint element

Login-config element

Security-Role Element

Env-entry Element

EJB-REF Element

Icon Element

The icon element specifies the location within the Web Application for a small and large image used to represent the Web Application in a GUI tool. (The servlet element also has an element called the icon element, used to supply an icon to represent a servlet in a gui tool.)

This Element is not currently used by WebLogic Server.

The Following Table Describes The elements you can define.

Element Required / Optional Description Optional Location for a small (16x16 pixel) .gif or .jpg image used to represent the Web Application in a GUI tool. Currently, this is not used by WebLogic Server. Optional location for a large (32x32 pixel) .gif or .jpg Image Used to represent the Web Application In A GUI Tool. Currently, this element is not used by Weblogic Server.

Display-name element

.........

Element Required / Optional Description Optional Currently, this element is not buy by WebLogic Server.

Description Element

THE OPTIONAL Description Element The Web Application.Element Required / Optional Description Optional Currently, this element is not buy by WebLogic Server.

Distributable element

The Distributable Element is not buy by WebLogic Server.

Element Required / Optional Description Optional Currently, this element is not buy by WebLogic Server.

Context-param Element

The optional context-param element declares a Web Application's servlet context initialization parameters. You set each context-param within a single context-param element, using and elements. You can access these parameters in your Code Using the javax.servlet.servletContext.getinitParameter () and javax.servlet.servletContext.getinitParameterNames () Methods.

.

Element Required / Optional Description Required The name of a parameter. Required The value of a parameter. Optional a Text Description of a parameter.

Filter Element

.....................

The Following Table Describes The Elements You CAN Define Withnin a servlet element.

Element Required / Optional Description Optional Specifies the location within the Web Application for a small and large image used to represent the filter in a GUI tool. Contains a small-icon and large-icon element. Currently, this element is not used by WebLogic Server. Required Defines the name of the filter, used to reference the filter definition elsewhere in the deployment descriptor. Optional A short name intended to be displayed by GUI tools. Optional A text description of the filter. Required The fully-qualified class name of the filter. Optional Contains a name / value pair as an initialization parameter of the filter. Use a separate set of Tags for Each Parameter.Filter-mapping ELEMENT

The Following Table Describes the elements you can define..

Element Required / Optional Description Required The name of the filter to which you are mapping a URL pattern or servlet. This name corresponds to the name assigned in the element with the element. < url-pattern> Required - or map by Describes a pattern used to resolve URLs The portion of the uRL after the http: // host: port ContextPath is compared to the by WebLogic Server If.. the patterns match, the filter mapped in this element is called Example patterns:. / soda / grape / * / foo / * /contents*.foo The URL must follow the rules specified in Section 10 of the Servlet 2.2 Specification . Required - or map by The name of a servlet which, if called, causes this filter to execute.

Listener ElementDefine An Application Listener Using The Listener Element.

Element Required / Optional Description Optional name of the class.

For more information, see configuring an Event listener.

Servlet Element

The Servlet Element Contains The Declarative Data of a servlet.

IF a JSP-File Is Specified and The Element is present, The JSP IS Precompiled and loaded When Weblogic Server Starts.

The Following Table Describes The Elements You CAN Define Withnin a servlet element.

Element Required / Optional Description Optional Location within the Web Application for a small and large image used to represent the servlet in a GUI tool. Contains a small-icon and large-icon element. Currently, this element is not used by WebLogic Server. Required Defines the canonical name of the servlet, used to reference the servlet definition elsewhere in the deployment descriptor. Optional A short name intended to be displayed by GUI tools. Optional A Text description of the servlet. Required (or use ) The full-qualified class name of the servlet. Use online> tags or tags in your servlet body. Required (or use ) The full path to a JSP file within the Web Application, relative to the Web Application root directory. use only one of either the tags or tags in your servlet body. Optional Contains a name / value pair as an initialization parameter of the servlet. Use a separate set of tags for each parameter. Require WebLogic Server initializes this servlet when WebLogic Server starts up. The content of this element must be a positive integer indicating the order in which the servlet should be loaded. Lower integers are loaded before higher integers. If no value is specified, or if the value specified is not a positive integer, WebLogic Server can load the servlet in Any Order in The Startup Sequence. Optional Used to Link A Security Role Name Defined by

To an alternative role name this is hard code in the servlet logic. this extra layer of abstract allows the servlet to be configured at Deployment WITHOUT CHANGING Servlet Code.icon Element

This is an element within the servlet element.

. T.....................

The Following Table Describes The elements you can define.

Element Required / Optional Description Optional Specifies the location within the Web Application for a small (16x16 pixel) .gif or .jpg image used to represent the servlet in a GUI tool. Currently, this element is not used by WebLogic Server. Optional Specifies the location within the Web Application for a small (32x32 pixel) .gif or .jpg image used to represent the servlet in a GUI tool. Currently, this element is not used by WebLogic Server.

Init-param element

This is an element within the servlet element.

The Optional Init-Param Element Contains A Name / Value Pair as an inTILALIZATION Parameter of the servlet. Use a Separate Set of init-param tags for each parameter.

You can access these parameters with the javax.servlet.servletconfig.getinitParameter () Method.

The Following Table Describes The Elements You CAN Define Withnin A INIT-Param Element.

Element Required / Optional Description Required Defines the name of this parameter. Required Defines a String value for this parameter. Optional Text description of the initialization parameter.

. WebLogic Server recognizes the special initialization parameter, wl-dispatch-policy, to assign a servlet or JSP to an available execute queue For example, the following example assigns a servlet to use the execute threads available in an execute queue named CriticalWebApp:

...

wl-dispatch-policy

criticWebApp

If the CriticalWebApp queue is not available, the servlet will use execute threads available in the default WebLogic Server execute queue. See Setting Thread Count for more information about configuring execute threads in WebLogic Server. See Using Execute Queues to Control Thread Usage for more information about Creating and using queues.

Security-Role-Ref Element

This is an element within the servlet element.

The security-role-ref element links a security role name defined by to an alternative role name that is hard-coded in the servlet logic. This extra layer of abstraction allows the servlet to be configured at deployment without changing servlet Code.

.

Element Required / Optional Description Optional Text description of the role. Required Defines the name of the security role or principal that is used in the servlet code. Required Defines the name of the security Role That Is Defined in a Element Later in The Deployment Descriptor.

servlet-mapping element

The servlet-mapping element defines a mapping between a servlet and a url pattern.

The following table describes the elements you can define within a servlet-mapping element.Element Required / Optional Description Required The name of the servlet to which you are mapping a URL pattern. This name corresponds to the name you assigned a . servlet in a declaration tag Required Describes a pattern used to resolve URLs The portion of the uRL after the http:. // host: port WebAppName is compared to the by WebLogic . Server If the patterns match, the servlet mapped in this element will be called Example patterns:. / soda / grape / * / foo / * /contents*.foo The URL must follow the rules specified in Section 10 of the Servlet 2.2 Specification For Additional Examples of servlet mapping, see servlet mapping.

Session-Config Element

The session-config element defines the session parameters for this Web Application.

The Following Table Describes The Element You CAN Define Wtem.

Element Required / Optional Description Optional The number of minutes after which sessions in this Web Application expire. The value set in this element overrides the value set in the TimeoutSecs parameter of the element in the WebLogic- Specific Deployment Descriptor WebLogic.xml, Unless Here is Entered. Default Value: -2 Maximum Value: Integer.max_Value ÷ 60 Special Values:

-2 = Use the value set by TimeoutSecs in element of weblogic.xml -1 = Sessions do not timeout. The value set in element of weblogic.xml is ignored. For more information, see Session-Descriptor Element.

MIME-MAPPING ELEMENT

The mime-mapping element defines a mapping between an extension and a mime type.

The Following Table Describes The Elements You CAN Define Withnin A Mime-maping Element.

Element Required / Optional Description Required A string describing an extension, for example:. Txt Required A string describing the defined mime type, for example:. Text / plain The following default mime types are provided with WebLogic Server (You can override these): Set1iFnone (MIMETYPESMAP, "HTML", "Text / HTML"); Set1 (MimeTypeSmap, "HTM", "Text / HTML"); Set1Ifnone (MimeTypeSmap, "GIF", "Image / GIF "); setifnone (MIMETYPESMAP," JPEG "," iMage / JPEG "); Set1Ifnone (MimeTypeSmap," JPG "," Image / JPEG "); Set11 (MimeTypeSmap," PDF "," Application / PDF "); setifnone MIMETYPESMAP, "ZIP", "Application / Zip"); Set1Ifnone (MimeTypeSmap, "Class", "Application / X-Java-VM"); Set1Ifnone (MimeTypeSmap, "Jar", "Application / X-java-archive") Setifnone (MIMETYPESMAP, "SER", "Application / X-java-serialized-object"); Set1Ifnone (MimeTypeSmap, "EXE", "Application / Oct-stream"); ​​Set1Ifnone (MimeTypesmap, "TXT", "Text / Plain "); Set1Ifnone (MimeTypeSmap," Java "," Text / Plain "); // this is for javawebstart OU Ts of the box work setifnone (MIMETYPESMAP, "JNLP", "Application / X-java-jnlp-file");

Welcome-file-list element

The Optional Welcome-File-List Element Contains An Ordered List of Welcome-File Elements.

When the URL request is a directory name, WebLogic Server serves the first file specified in this element. If that file is not found, the server then tries the next file in the list.For more information, see Configuring Welcome Pages and How WebLogic Server Resolves http requests.

THE FOLLOWING TABLE Describes The element you can define forin a welcome-file-list element.

Element Required / Optional Description Optional File Name To Use As a Default Welcome File, Such as Index.html

Error-Page Element

THE OPTIONAL ERROR-Page Element Specifies a mapping Between an error code or resource in the Web Application.

When an error occurs-while WebLogic Server is responding to an HTTP request, or as a result of a Java exception-WebLogic Server returns an HTML page that displays either the HTTP error code or a page containing the Java error message. You can define your OWN HTML Page to Be Displayed in Place of these Default Error Pages Or in response to a java exception.

For more information, see customizing http error resolves http requests.

The Following Table Describes The Elements You CAN Define Withn ire-page element.

NOTE: Define Either an or an But not Both.

Element Required / Optional Description Optional A valid HTTP error code, for example, 404. Optional A fully-qualified class name of a Java exception type, for example, java.lang.string Required the location of the resource to display in response to the error. For example, /myerrorpg.html.

Taglib Element

THE OPTIONAL TAGLIB Element Describes a JSP TAG LIBRARY.

This element associates the location of a JSP Tag Library Descriptor (TLD) with a URI pattern. Although you can specify a TLD in your JSP that is relative to the WEB-INF directory, you can also use the tag to configure the .

Element Required / Optional Description Required Gives the file name of the tag library descriptor relative to the root of the Web Application. It is a good idea to store the tag library descriptor file under the WEB-INF directory so it is not publicly available over an HTTP request. Required Describes a URI, relative to the location of the web.xml document, identifying a Tag Library used in the Web Application. If the URI matches the URI string used in the taglib Directive on the JSP page, this taglib is ready.

Resource-Ref Element

The optional resource-ref element defines a reference lookup name to an external resource. This allows the servlet code to look up a resource by a "virtual" name that is mapped to the actual location at deployment time.

Use a separate element to define each external resource name. The external resource name is mapped to the actual location name of the resource at deployment time in the WebLogic-specific deployment descriptor weblogic.xml.

.

Element Required / Optional Description Optional A text description. Required The name of the resource used in the JNDI tree. Servlets in the Web Application use this name to look up a reference to the resource. < res-type> Required The Java type of the resource that corresponds to the reference name. Use the full package name of the Java type. Required Used to control the resource sign on for security. If set to APPLICATION, indicates that the application component code performs resource sign on programmatically. If set to CONTAINER WebLogic Server uses the security context established with the login-config element. See login-config Element. Optional Specifies whether connections obtained through the given Resource Manager Connection Factory Reference Can Be Shared. Valid Values: Shareable unshareable

Security-construint element

.

For More Information, See Configuring Security In Web Applications.

The Following Table Describes The Elements You CAN Define Withnin A Security-Constraint Element.

Element Required / Optional Description Required Defines the components of the Web Application to which this security constraint is applied. Optional Defines which groups or principals have access to the collection of web resources defined in this SECURITY CONSTRAINT. See Also Auth-Constraint Element. Optional defines how the client. See Also User-Data-Constraint Element Element Element Element Element Element Element ELEMENT ELEMENT

web-resource-collection ElementEach element must have one or more elements. These define the area of ​​the Web Application to which this security constraint is applied.

THIS IS An Element Wtem.

The Following Table Describes The Elements You CAN Define Withnin A Web-Resource-Collection Element.

Element Required / Optional Description Required The name of this Web resource collection. Optional A text description of this security constraint. Optional Use one or more of the elements to declare to which URL patterns this security constraint applies. If you do not use at least one of these elements, this is ignored by WebLogic Server. Optional use one or more of the elements to declare which HTTP methods (usually, GET or POST) are subject to the authorization constraint. If you omit the element, the default behavior is to apply the security constraint to all HTTP methods.

Auth-construint element

THIS IS An Element Wtem.

.......................

The Following Table Describes The Elements You CAN Define With Auth-Constraint Element.

Element Required / Optional Description Optional A text description of this security constraint. Optional Defines which security roles can access resources defined in this security-constraint. Security role names are mapped to principals using the security-role- Ref element. See security-role-ref element.user-data-constraint element

THIS IS An Element Wtem.

.

.

Element Required / Optional Description Optional A text description. Required Specifies that the communication between client and server. WebLogic Server establishes a Secure Sockets Layer (SSL) connection when the user is authenticated using the INTEGRAL or CONFIDENTIAL transport Guarantee. Range of Values:

NONE-The application does not require any transport guarantees. INTEGRAL-The application requires that the data be sent between the client and server in such a way that it can not be changed in transit. CONFIDENTIAL-The application requires that data be transmitted so as to Prevent Other Entities from Observing The Contents of The Transmission.

Login-config element

.

If this element is present, the user must be authenticated in order to access any resource that is constrained by a defined in the Web Application. Once authenticated, the user can be authorized to access other resources with access privileges.The Following Table Describes the elements you can define forin a login-config element.

Element Required / Optional Description Optional Specifies the method used to authenticate the user Possible values:. BASIC - uses browser authenticationFORM - uses a user-written HTML formCLIENT-CERT Optional The name of the realm that Is Reference to Authenticate The User Credentials. IF Omitted, The Realm Defined with The Auth Realm Name Field on The Web Application

->

CONFIGURATION

->

Other tab of the Administration Console is used by default For more information, see Specifying a Security Realm Note:... The element does not refer to security realms within WebLogic Server This element defines the realm name to use in HTTP Basic authorization Note:.. The system security realm is a collection of security information that is checked when certain operations are performed in the server The servlet security realm is a different collection of security information that is checked when a page is accessed and basic authentication is Used. Optional Use this element if you configure the to form. See form-login-config element.

Form-login-config element

This is an element within the login-config element.

Use the Element if you configure the to form.

.

Element Required / Optional Description Required The URI of a Web resource relative to the document root, used to authenticate the user. This can be an HTML page, JSP, or HTTP servlet, and must return an HTML page containing a fORM that conforms to a specific naming convention. for more information, see Setting Up Authentication for Web Applications. Required The URI of a Web resource relative to the document root, sent to the user in response to a failed authentication login.security-role element

The Following Table Describes The Elements You CAN Define Withnin A Security-Role Element.

Element Required / Optional Description Optional A text description of this security role. Required The role name. The name you use here must have a corresponding entry in the WebLogic-specific deployment descriptor, weblogic.xml, which Maps Roles to Principals In The Security Realm. For more information, see security-role-assignment element.

Env-entry Element

.....................

The Following Table Describes The Elements You CAN Define With Env-Entry Element.

Element Required / Optional Description Optional A textual description. Required The name of the environment entry. Required The value of the environment entry. Required the Type of the Environment Entry. Can be set to one of the following java types: java.lang.boolean java.lang.string java.lang.integer java.lang.double java.lang.float

EJB-REF Element

The optional ejb-ref element defines a reference to an EJB resource. This reference is mapped to the actual location of the EJB at deployment time by defining the mapping in the WebLogic-specific deployment descriptor file, weblogic.xml. Use a separate Element to define Each Reference EJB Name.THE FOLLOWING TABLE Describes The elements you can define forin an ejb-ref element.

Element Required / Optional Description Optional A text description of the reference. Required The name of the EJB used in the Web Application. This name is mapped to the JNDI tree in the WebLogic-specific deployment descriptor weblogic.xml. For more information, see ejb-reference-description Element. Required The expected Java class type of the referenced EJB. Required The fully qualified class name of the EJB home interface. < remote> Required The fully qualified class name of the EJB remote interface. Optional The of an EJB in an encompassing J2EE application package. Optional A security role whose security context is applied To The Reference EJB. Must Be a Security Role Defined with The Element.

转载请注明原文地址:https://www.9cbs.com/read-92647.html

New Post(0)