The Servlet Environment

We now turn our attention to servlets. Servlets are Java classes that can be loaded dynamically and run by a Java-enabled Web server. The Web server provides support for servlets with extensions called containers (also known as servlet engines).

Web clients (Web browsers) interact with the servlet using the HTTP request/response protocol that has been described earlier.

Servlet Containers

The servlet container provides the following services and functionality:

  • The network services over which the requests and responses are sent.

  • Registers the servlet against one or more URLs.

  • Manages the servlet lifecycle.

  • Decodes MIME-based requests.

  • Constructs MIME-based responses.

  • Supports the HTTP protocol (it can also support other protocols). ...

Get Sams Teach Yourself J2EE™ in 21 Days 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.