Servlet Life Cycle

As stated earlier, servlets are deployed within a servlet container, which in turn is hosted by a Web server. The particular capabilities and level of compliance of the Web server determines which version of the servlet specification you need to be working with.

The basic behavior of a servlet involves a request-response type model derived from the way the HTTP works; thus, the inherent applicability as a Web component. This behavior is illustrated via a statechart diagram in Figure 10-1.

Figure 10-1. Servlet life cycle

Servlets are built as Java classes that extend one of two basic servlet implementation classes: HttpServlet ...

Get Developing Enterprise Java Applications with J2EE™ and UML 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.