The role of Load-on-startup in Web. xml

Source: Internet
Author: User

Reprinted blog:

The following configuration, familiar with DWR is familiar:

We notice that it contains this configuration: <load-on-startup>1</load-on-startup> So what does this configuration do?

an explanation of the original English is as follows:
Servlet Specification:
The load-on-startup element indicates, this servlet should is loaded (Instantiated and has its init () called

The meaning of the translation comes roughly as follows:
1) The Load-on-startup element flags whether the container loads the servlet at startup (instantiating and invoking its init () method).

2) Its value must be an integer indicating the order in which the servlet should be loaded

2) A value of 0 or greater than 0 o'clock indicates that the container loads and initializes the servlet when the application is started;

3) When the value is less than 0 or unspecified, the container will not load until the servlet is selected.

4) The lower the value of a positive number, the higher the precedence of the servlet, and the more loaded it will be when the app starts.

5) At the same time, the container will be loaded in its own order of choice.

So, <load-on-startup>x</load-on-startup>, the value 1,2,3,4,5 in X represents the priority, not the start delay time.

The following topics:

What definitions are not included in 2.web.xml (multiple selection)

A. default start Page

B.servlet Start delay time definition

C.error Processing Page

Reload time after d.jsp file changes


Most servlets are usually created and initialized by the application server when the user first requests it, but <load-on-startup>n</load-on-startup> can be used to change the situation. Change the priority of loading according to your needs!

The role of Load-on-startup in Web. xml

Related Article

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: 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.