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.