Servlet lifecycle
The process of adding a wrapper to its context causes the wrapper's start()
method to be invoked. A key task of this method is to set its available
member to zero.
This member indicates the time (in milliseconds) when a servlet is expected to be ready to serve requests. If this is zero, the servlet is ready and able to serve. If it is a positive value, then the servlet is expected to be available at the specified future time, and requests for it are handled by returning an SC_SERVICE_UNAVAILABLE
response. On the other hand, a servlet whose available
member is set to Long.MAX_VALUE
is considered to be permanently unavailable, and requests are responded to with an SC_NOT_FOUND
error.
As we saw in the last chapter, servlets can also be marked as needing to be loaded during the context's startup process using the<load-on-startup>
element in the web deployment descriptor.
Loading a servlet
A context loads a wrapper by invoking its load()
method.
A non-null instance
member...