The JavaTM Tutorial

| Start of Tutorial > Start of Trail > Start of Lesson | Search Feedback Form

Trail: Servlets
Lesson: Overview of Servlets

## The Example Servlets

> The remaining lessons in this trail show you how to write HTTP servlets. Some knowledge of the HTTP protocol is assumed; to learn more about the HTTP protocol, you could look at the RFC for HTTP/1.1.

> The lessons use an example called Duke's Bookstore, a simple on-line bookstore that allows a customer to perform various functions. Each function is provided by a servlet:

> Function | Tomcat Servlet | JSDK2.1 Servlet
> --- | --- | ---
> Browse the books offered for sale | ``CatalogServlet`` | ``CatalogServlet``
> Buy a book by placing it in a "shopping cart" | ``CatalogServlet`` | ``CatalogServlet``
> Get more information on a specific book | ``BookDetailServlet`` | ``BookDetailServlet``
> See the books that have been selected for purchase | ``ShowCartServlet`` | ``ShowCartServlet``
> Remove one or more books from the shopping cart | ``ShowCartServlet`` | ``ShowCartServlet``
> Buy the books in the shopping cart | ``CashierServlet`` | ``CashierServlet``
> Receive a Thank-You for the purchase | ``ReceiptServlet`` | ``ReceiptServlet``

> The lessons use the servlets to illustrate various tasks. For example, the BookDetailServlet is used to show you how to handle HTTP GET requests and the CatalogServlet is used to show you session tracking.

> Several source files comprise the Duke's Bookstore example. For your convenience, we include two downloadable zip archives: one contains all of the source files necessary to build and run the example using Tomcat, the other contains all of the source file necessary to build and run the example using JSDK2.1.

> Download the zip archive for Tomcat

> Download the zip archive for JSDK2.1

> To run the example, first start a process that runs servlets, such as Tomcat or the JSDK2.1 server. Once the process is running, call the servlet from a browser.

| Start of Tutorial > Start of Trail > Start of Lesson | Search Feedback Form

Copyright 1995-2001 Sun Microsystems, Inc. All rights reserved.