J2EE Deployment Files (Web.xml)

xiaoxiao2021-03-06  25

This file contains the configuration for a web-application. The icon element contains a small-icon and a large-icon element which specify the location within the web application for a small and large image used to represent The Web Application In A Gui Tool. path / to / icon.gif The small-icon element contains the location forin the Web Application of a File Containing A Small (16x16 Pixel) icon Image ................................................ .. icon element contains the location within the web application of a file containing a large (32x32 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg". A Friendly Name a friendly name what describes this unit. The description A Short Description, Use etc. The distributable element, by its presence in a web application deployment descriptor, indicates that this web application is programmed appropriately to be deployed into a distributed servlet container. The context-param element contains the declaration of a web Application '

s servlet context initialization parameters. There are two special kinds of initialization parameters for the optional cases where the parameter is used to obtain the JNDI name of an EJB or a data source for a subsequent look up. These are indicated by an context-param element together with an accompanying ejb-ref or resource-ref element with matching name. theName The name of the configuration parameter. theValue The value of the configuration parameter. The servlet element contains the declarative data of a servlet. If a jsp-file is specified and the load-on-startup element is present, then the JSP should be precompiled and loaded. The icon element contains a small-icon and a large-icon element which specify the location within the web application for a small and large image used to represent the web application in a GUI tool. path / to / icon.gif < / small-icon> The Small-icon Element Contains The Location Within The Web Application of A File Containing A Small (16x16 Pixel) icon Image. The Image Must Be Either Gif or Jpeg Format and The FileName Must End with The Extension of ".gif" OR ".jpg". Path /to/icon.gifThe large-icon element contains the location within the web application of a file containing a large (32x32 pixel) icon image. The image must be either GIF or JPEG format and the filename must End with the extension of ".gif" or ".jpg". servletname The canonical name of the servlet. a friendly name a friendly Name That describes this unit.

Description> The description a short description, use etc. com.company.servlet.dummyservlet The class name of a servlet. jsp / file / name .jsp The path to a jsp file within the web application. Contains a name / value pair initialization param. The name of the configure parameter. theValue The value of the configuration parameter. priorityNumber Indicates that this servlet should be loaded on startup. The optional contents of these element must be an integer indicating the order in which the servlet should be loaded. The security-role-ref element contains the declaration of a security role reference in the servlet's code. The contents of the role -Name Element is this of the string used in the servlet code to specify a role. The role-link element specifies That this code whip be linked to a role de scribed by the security-role element. The description A short description, use etc. myRole Defines a role name that the developer can use. The deployer maps a set of users and groups to the role name at deployment time. realname The role-link element is used to link a security role reference to a defined security role. The role-link element must Contain the name of one of the security-role elements. defines a maping between a servlet and a url pattern. servletname <

/ servlet-name> The canonical name of the servlet. / *. Thepattern the url pattern of the mapping. defines the session parameters for this Web Application. session-timeout Defines the default session timeout interval for all sessions created in this web application. The default units are measured in minutes. Defines a mapping between and extension and a mime type .txt An extension. Example: ".txt". text / plain a defined mime type. example: "text / place". An ordered list of welcome files. index.html A welcome file, this file will be served to the user for incoming requests without a file specified (specifying a directory) if IT EXISTS. EXAMPLES Are: index.html, default.jsp, other.file. Contains a mapping between an error code or exception type to the path of a resource in the web application. TheerrorCodenumber The http error code, ex: 404. java.exception.typeofexception a java exception type. Path / to / resource < / location> The location of the resource in the web application. The optional resource-ref element contains a declaration of a Web Application's reference to an external resource. An context-param with the same name must be present whose value Will Be The JNDI Data Source. The Context-Param's Value May Be Specified At Deployment Time. The Description

A short description, use etc. theContextParam Specifies the name of the resource factory reference name. This value is the name of the context-param whose value contains the JNDI name of The Data Source. com.the.typeofresource specifies the data source. container | servlet the res-auth element indicates whether the application component code performs resource signon programmatically or whether the container signs onto the resource based on the principle mapping information supplied by the deployer. Must be CONTAINER or SERVLET. Used to associate security constraints with one or more web resource collections. Used to identify a subset of the resources and HTTP methods on those resources within a web application to which a security constraint applies. The resource name The name of this Web Resource Collection. The Description A Short Description, Use etc. / *. Thepattern the url pattern of the mapping. method A HTTP method (GET | POST | ...).. Indicates the user roles that should be permitted access to this resource collection as well as the authorization method to be used The description A Short Description, Use etc. myrole defines a role name That The developer can use. The Deployer Maps a set of users and groups to the role name at deployment time.

Used to indicate how data communicated between the client and container should be protected. The description A short description, use etc. NONE / INTEGRAL / CONFIDENTIAL The transport- guarantee element specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL. The login-config element is used to configure the authentication method that should be used, the realm name that should be used for this application, and the attributes that are needed by the form login mechanism. BASIC / DIGEST / fORM / CLIENT-CERT The auth-method element is used to configure the authentication mechanism for the web application . As a prerequisite to gaining access to any web resources which are protected by an authorization constraint, a user must have authenticated using the configured mechanism. Legal values ​​for this element are "BASIC", "DIGEST", "FORM", or "CLIENT -Cer T ". Name Of Realm The realm name element specifies the realm name to use in HTTP Basic authorization. The form-login-config element specifies the login and Error Pages That Should Be Used in form based bodyation is not used, These elements area ignored. path / to / loginpage.jsp defines the location in The Web App where the page. is buy. path / to / errorpage.jsp

Defines the location in the web app where the error page that is displayed when login is not successful can be found. The security-role element contains the declaration of a security role which is used in the security-constraints placed on the web application. The description A short description, use etc. myRole Defines a role name that the developer can use. The deployer maps a set of users and groups to the role name at deployment time. The env-entry element contains the declaration of an application's environment entry. This element is required to be honored on in J2EE compliant servlet containers. The description A short description, use etc. nameOfentry The Env-entry-name contains the name of an application's environment entry. value The Env-Entry-Value Element Contains The Value of An Application's Environment Ent ry. java.lang.String The env-entry-type element contains the fully qualified Java type of the environment entry value that is expected by the application code. The following Are the legal value: java.lang.boolean, java.lang.string, java.lang.integer, java.lang.double, java.lang.float. Used in Conjunction with a matching context-param of the same name to indicate that this parameter will be used to obtain the JNDI name of an EJB. The description A short description, use etc. nameOfEJB

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

New Post(0)