分享
 
 
 

J2EE deployment files(web.xml)

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

<web-app>

This file contains the configuration for a web-application.

<icon>

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.

<small-icon>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".

<large-icon>path/to/icon.gif</large-icon>

The 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".

<display-name>A friendly name</display-name>

A friendly name that describes this unit.

<description>The description</description>

A short description, use etc.

<distributable />

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.

<context-param>

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.

<param-name>theName</param-name>

The name of the configuration parameter.

<param-value>theValue</param-value>

The value of the configuration parameter.

<servlet>

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.

<icon>

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.

<small-icon>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".

<large-icon>path/to/icon.gif</large-icon>

The 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".

<servlet-name>servletname</servlet-name>

The canonical name of the servlet.

<display-name>A friendly name</display-name>

A friendly name that describes this unit.

<description>The description</description>

A short description, use etc.

<servlet-class>com.company.servlet.DummyServlet</servlet-class>

The class name of a servlet.

<jsp-file>jsp/file/name.jsp</jsp-file>

The path to a JSP file within the web application.

<init-param>

Contains a name/value pair initialization param.

<param-name>theName</param-name>

The name of the configuration parameter.

<param-value>theValue</param-value>

The value of the configuration parameter.

<load-on-startup>priorityNumber</load-on-startup>

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.

<security-role-ref>

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 that of the String used in the servlet code to specify a role. The role-link element specifies that this coded role should be linked to a role described by the security-role element.

<description>The description</description>

A short description, use etc.

<role-name>myRole</role-name>

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.

<role-link>realname</role-link>

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 roles defined in the security-role elements.

<servlet-mapping>

Defines a mapping between a servlet and a url pattern.

<servlet-name>servletname</servlet-name>

The canonical name of the servlet.

<url-pattern>/*.thePattern</url-pattern>

The url pattern of the mapping.

<session-config>

Defines the session parameters for this web application.

<session-timeout>session-timeout</session-timeout>

Defines the default session timeout interval for all sessions created in this web application. The default units are measured in minutes.

<mime-mapping>

Defines a mapping between and extension and a mime type.

<extension>.txt</extension>

An extension. example: ".txt".

<mime-type>text/plain</mime-type>

A defined mime type. example: "text/plain".

<welcome-file-list>

An ordered list of welcome files.

<welcome-file>index.html</welcome-file>

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.

<error-page>

Contains a mapping between an error code or exception type to the path of a resource in the web application.

<error-code>theErrorCodeNumber</error-code>

The HTTP error code, ex: 404.

<exception-type>java.exception.TypeOfException</exception-type>

A Java exception type.

<location>path/to/resource</location>

The location of the resource in the web application.

<resource-ref>

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.

<description>The description</description>

A short description, use etc.

<res-ref-name>theContextParam</res-ref-name>

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.

<res-type>com.the.TypeOfResource</res-type>

Specifies the (Java class) type of the data source.

<res-auth>CONTAINER|SERVLET</res-auth>

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.

<security-constraint>

Used to associate security constraints with one or more web resource collections.

<web-resource-collection>

Used to identify a subset of the resources and HTTP methods on those resources within a web application to which a security constraint applies.

<web-resource-name>The resource name</web-resource-name>

The name of this web resource collection.

<description>The description</description>

A short description, use etc.

<url-pattern>/*.thePattern</url-pattern>

The url pattern of the mapping.

<http-method>METHOD</http-method>

A HTTP method (GET | POST |...).

<auth-constraint>

Indicates the user roles that should be permitted access to this resource collection as well as the authorization method to be used.

<description>The description</description>

A short description, use etc.

<role-name>myRole</role-name>

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.

<user-data-constraint>

Used to indicate how data communicated between the client and container should be protected.

<description>The description</description>

A short description, use etc.

<transport-guarantee>NONE/INTEGRAL/CONFIDENTIAL</transport-guarantee>

The transport-guarantee element specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL.

<login-config>

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.

<auth-method>BASIC/DIGEST/FORM/CLIENT-CERT</auth-method>

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-CERT".

<realm-name>Name Of Realm</realm-name>

The realm name element specifies the realm name to use in HTTP Basic authorization.

<form-login-config>

The form-login-config element specifies the login and error pages that should be used in form based login. If form based authentication is not used, these elements are ignored.

<form-login-page>path/to/loginpage.jsp</form-login-page>

Defines the location in the web app where the page that is used for login can be found.

<form-error-page>path/to/errorpage.jsp</form-error-page>

Defines the location in the web app where the error page that is displayed when login is not successful can be found.

<security-role>

The security-role element contains the declaration of a security role which is used in the security-constraints placed on the web application.

<description>The description</description>

A short description, use etc.

<role-name>myRole</role-name>

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.

<env-entry>

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.

<description>The description</description>

A short description, use etc.

<env-entry-name>nameOfEntry</env-entry-name>

The env-entry-name contains the name of an application's environment entry.

<env-entry-value>value</env-entry-value>

The env-entry-value element contains the value of an application's environment entry.

<env-entry-type>java.lang.String</env-entry-type>

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 values of env-entry-type: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Float.

<ejb-ref>

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.

<description>The description</description>

A short description, use etc.

<ejb-ref-name>nameOfEJB</ejb-ref-name>

Contains the name of an EJB reference. This name must match an context-param name.

<ejb-ref-type>com.type.OfEJBBean</ejb-ref-type>

Contains the expected java class type of the referenced EJB.

<home>com.type.OfEJBHome</home>

Contains the fully qualified name of the EJB's home interface.

<remote>com.type.OfEJB</remote>

Contains the fully qualified name of the EJB's remote interface.

<ejb-link>nameOfEJB</ejb-link>

Used in the ejb-ref element to specify that an EJB reference is linked to an EJB in an encompassing J2EE application package. The value of the ejb-link element must be the ejb-name of and EJB in the J2EE application package.

<taglib>

Defines a taglib name in order to simplify the definition inside JSP-pages.

<taglib-uri>myTags</taglib-uri>

The uri as defined in the taglib directive in the JSP-pages.

<taglib-location>/WEB-INF/lib/mytags.jar</taglib-location>

The location of the library or a standalone TLD (relative or absolute URL).

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有