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

Get Tomcat 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.