主题:Help needed
Create a web page to sell things (let’s say book or clothes or anything up to your imagination).
In "real life" such a web page would be backed by a database, but since we haven’t covered database so we’ll do without.
The goal of this work 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.
Details:
• 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 T-shirt at RBM 100 each, RMB 1200) 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.)