JAVA configuration file web. config [load-on-startup configuration item parsing]

Source: Internet
Author: User

 

When developing JAVA applications, you should be familiar with the following configurations.


BuildData
Com.cn. web. servlet. BuildDataServlet
1


BuildData
/BuildData

We noticed the red configuration item. What is the role of this configuration item?

It is roughly described as follows:

1) the load-on-startup element indicates whether the container loads the servlet at startup (instantiate and call its init () method ).

2) its value must be an integer, indicating the order in which the servlet should be loaded.

2) When the value is 0 or greater than 0, it indicates that the servlet is loaded and initialized when the application is started;

3) if the value is smaller than 0 or is not specified, the container is loaded only when the servlet is selected.

4) The smaller the positive value, the higher the servlet priority, the more loaded the application is at startup.

5) when the values are the same, the container selects the order for loading.

So, X In, the values of x are 1, 2, 3, 4, and 5, indicating the priority rather than the start delay time, when you need to load web program configuration and public variables into the memory as soon as the program is started, modules such as database connection pool and initialization data need to be started first, set the value to a smaller integer.

 

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