Web. XML Loading sequence

Source: Internet
Author: User

One

1. Start the Tomcat startup Web project, first read the XML file in the <context-param> and <listener>

2. The container creates a ServletContext (servlet context), and all parts of the Web project will share this context.

3. The container converts <context-param> into a key-value pair and gives it to ServletContext.

4. The container creates a class instance in <listener>, creating the listener.

Two

The Load-on-startup element specifies the order in which the servlet is loaded when the Web application is launched, and its value must be an integer. If its value is a negative integer or the element does not exist, the container will load the servlet when the servlet is called. If the value is a positive integer or 0, the container loads and initializes the servlet when configured, and the container must ensure that the value is loaded first. If the values are equal, the container can automatically select who to load first.

Three

context-param–> listener–> filter–> servlet

Details: http://www.educity.cn/java/689206.html

Web. XML Loading sequence

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.