CIT 597 Assignment 9: Commercial Servlets
Fall 2003, David Matuszek

Purpose of this assignment:

Idea of the assignment:

As we all know, the real purpose of the World Wide Web is to sell things. The idea of this assignment is to create a web page to sell things.

In "real life" such a web page would be backed by a database, but since we can't easily set up a database (mySQL is hard to install, and Access 2000 is expensive), we'll do without.

The goal of this assignment is simply to get servlets and JSP working. Other details are not important. Your arithmetic should be correct (compute the cost correctly), but your pages don't have to be pretty or anything like that.


Using an HTML <form>, set up a static web page that lists a few items for sale, along with their prices. You should have a quantity field for each item, so that the user can order more than one of each item. Use your imagination in terms of what to sell. Three kinds of items is enough--you can have more, but keep the page small and simple.

When the initial page is submitted (via GET or POST, your choice), use Java's Session Tracking API to remember this information. Use a servlet to return a page that displays the user's choices, the cost per item (for example, 12 widgets at $0.75 each, $9.00) and the total cost (no sales tax, no shipping charges). This second page should ask for the user's name, address, and credit card number. Again, don't get carried away, we're oversimplifying things in order to concentrate on the servlets.

When the second page is submitted, use JSP to create a third page to thank the user (by name--Thank you for your order, John Smith), again display the user's choices, and say how much has been billed to the credit card. (This page is virtually the same as the second page; the real purpose is to give you a feel for the differences between using a plain servlet and using JSP.)

Due date:

Tuesday, November 25, before midnight.