Previous | Next | Trail Map | Servlets | Contents


by Cynthia Bloch

The Servlets trail teaches you about servlets, the bodies of code that run inside servers, and extend their functionality. For example, servlets offer an efficient platform-independent replacement for CGI scripts. Servers that can host servlets are Java-enabled servers that respond to client requests.

This is a draft! Please send comments and suggestions on this trail to putting the word "servlets" in the subject.

Overview of Servlets tells you what servlets are, and how you can use them. The lesson also introduces the example servlets used in this trail.

Client Interaction shows you how to write servlets that interact with clients. The servlets in this lesson respond to HTTP GET, HEAD and POST requests. The lesson also discusses threading issues, and shows you how to avoid problems by creating a servlet that responds to one client at a time.

The Life Cycle of a Servlet discusses the significant events in the life of a servlet and shows you how to customize servlet initialization and shutdown.

Saving Client State shows you how to use session tracking and cookies.

The servletrunner Utility describes how to set-up and run a utility called servletrunner to test your servlets. The servletrunner utility comes with the Servlet Development Kit, and is part of the servlet extension to the Java Development Kit.

Running Servlets shows you how to call servlets in a variety of ways: from a browser, within an HTML page, and from another servlet.

Note: The servlet API is a standard extension to the Java Development Kit. The following lessons use the Java Servlet Development Kit 2.0. You can download the Servlet Development Kit from

Previous | Next | Trail Map | Servlets | Contents