Interpretation of common configurations in Web. xml

Source: Internet
Author: User

Article turned from: http://blog.csdn.net/sdyy321/article/details/5838791

There are versions, encodings, DTDs that are required for general XML

<web-app> the next element <welcome-file-list> is the default start page, in addition to this you can also define the following elements:

<context-param>:web Application servlet Context initialization parameter declaration

<DESCRIPTION>: Provides descriptive text about the Web application

<display-name>: Specifies the display name of the Web application

<DISTRIBUTABLE>: Specifies whether the Web application can be distributed processing

<ejb-ref>: Defining a reference to an EJB resource

<ejb-local-ref>: Declaring a reference to the enterprise bean local home directory

<env-entry>: Declares a replacement entry for the application. Each environment entry uses a separate element

<ERROR-PAGE>: Specifies the mapping between the error code or the exception type and the resource path in the Web application

<filter>: filter, child elements are:

<filter-name>: Filter Name:</filter-name> and <filter-class> filter class </filter-class>

<filter-mapping>: Filter map, child elements are:

<filter-name>, <url-pattern> and <dispatcher>

Url-pattern mode: A: Exact match: with/start, plus fully qualified name

B: Extension matches: ' *. extension '

C: Path mapping: End with/start with/*

D: Default: '/'

The configuration method is similar to the servlet, noting that the a:<url-pattern> can be replaced by <servlet-name>, which means that the servlet is bound.

The b:<dispatcher> is used to indicate how the filter corresponds to the request: divided into requests (when the element is not configured, the default

Include/forward (Request forwarding), error four.
C: When there are multiple filters in the Url-pattern phase, the order of the filter chains is executed in the order of the configuration files, but when

When there is a filter bound servlet, it will be executed last.

<icon>: Specifies the location of the image in the Web application that represents the size of the Web application in the GUI tool

<listener>: Listener

<LOGIN-CONFIG>: How to authenticate the user, the realm name applied to the application, the features required by the form login mechanism

<mime-mapping>: Define mappings between extension and MIME types

<resource-env-ref>:web declaration of an application's reference to a managed object that is associated with a resource in a Web application environment

<resource-ref>: Defines a reference lookup name for an external resource that can be used to look up a resource through a "virtual" name that maps to the actual location at the time of deployment. Child elements are:

< description> resource Description </description>

< name of the resource used in the Rec-ref-name>jndi tree </rec-ref-name>

< res-type> resource Types </res-type>

< res-auth>application| container</res-auth> resources are licensed by application or Container. If set to

Application, the application component code executes the resource logon programmatically. If set to CONTAINER,

The weblogicserver will use the security context established with the Login-config element

< res-sharing-scope>shareable| unshareable</res-sharing-scope> Whether the resource can be shared. Default value is shareable

<security-constraint>

<security-role>: Text description and role name for security roles

Declarative data for <servlet>:servlet

Mapping between <servlet-mapping>:servlet and URL patterns

<session-config>: Defining session attributes for Web applications

<taglib>: Description jsp Tag Library

Interpretation of common configurations in Web. xml

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.