Servlet load-on-startup

来自于译文资料
load-on-startup定义了servlet启动的顺序。如果是负数或未出现。如
<load-on-startup>-3</load-on-startup>则容器自由决定什么时加载,通常是请求servlet
到达时加载。
如果是正数或0,则部署的项目启动时就加载,加载顺序为数小的先加载。
加载的含义(实例化servlet并执行该servlet的init()方法。)

英文资料:

 The load-on-startup element indicates that this servlet should be loaded (instantiated and have its init() called) on the startup of the web application. The optional contents of these element must be an integer indicating the order in which the servlet should be loaded. If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses. If the value is a positive integer or 0, the container must load and initialize the servlet as the application is deployed. The container must guarantee that servlets marked with lower integers are loaded before servlets marked with higher integers. The container may choose the order of loading of servlets with the same load-on-start-up value. 

猜你喜欢

转载自bestchenwu.iteye.com/blog/1035737