|
|
Overview of 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 Servlet Browse the books offered for sale CatalogServletBuy a book by placing it in a "shopping cart" CatalogServletGet more information on a specific book BookDetailServletManage the Bookstore Database BookDBServletSee the books that have been selected for purchase ShowCartServletRemove one or more books from the shopping cart ShowCartServletBuy the books in the shopping cart CashierServletReceive a Thank-You for the purchase ReceiptServletThe lessons use the servlets to illustrate various tasks. For example, the BookDetailServlet is used to show you how to handle HTTP GET requests, the BookDBServlet is used to show you how to initialize a servlet, and the CatalogServlet is used to show you session tracking.
Several source files comprise the Duke's Bookstoreexample. For your convenience, we include a downloadable zip archive that contains all of the source files necessary to build and run the example.
To run the example, you will need to start
servletrunneror a web server, and call the servlet from a browser
|
|
Overview of Servlets |