Exercises

Included below are short-answer and programming exercises. Answers are provided for those exercises whose exercise number is a hyperlink. Because college faculty use these exercises in their exams, we have provided answers to roughly half of the exercises included here.


19.3 Modify the Cookie example in of Figs. 19.9 through 19.11 to have the book recommendation list prices for each book. Also, allow the user to select some or all of the recommended books and "order" them.

19.4 Modify the HttpSession example in of Fig. 19.13 through 19.15 to have the book recommendation list prices for each book. Also, allow the user to select some or all of the recommended books and "order" them.

19.5 Modify the GuestBook example in Figs. 19.16 and 19.17 to implement the fields Address1, Address2, City, State and Zip. Modify it further to lookup a guest by name or email address and return an HTML page with all of the guest's information.

19.6 Modify the servlet of Fig. 19.7 to synchronize access to the survey.txt file using the techniques illustrated in Chapter 15, "Multithreading."

19.7 Modify the servlet of Fig. 19.7 to synchronize access to the survey.txt file by having the HTTPPostServlet class implement javax.servlet.SingleThreadModel.

19.8 (Project: Auction Servlet) Create your own auction servlet. Create a database of several items that are being auctioned. Make a Web page that allows the user to select an item on which to place a bid. When the user places the bid they should be notified if the bid is lower than the previous high bid and asked to submit their bid again. Allow the user to return to the servlet and query it to determine if they won the auction.

19.9 Modify Exercise 19.8 to use session tracking such that when the client connects to the servlet again, the client is automatically sent a web page indicating the status of the bidding on the items for which they have previously bid.


Selected Answers

Included below are answers to approximately half the of the exercises in the Cyber Classroom. We are not able to include answers to every exercise because college faculty use these exercises in their classroom exams.


None Available