Java Reference
In-Depth Information
18.10
R ESOURCES
The definitive place for all the details is the Java Web site at Sun, 3 particularly
the pages dealing with javax.servlet.http classes.
Some of the best material on servlets comes from:
Core Servlets and JavaServer Pages by Marty Hall and Larry Brown, ISBN
0-13-009229-0, a Prentice Hall PTR book.
• Its sequel, More Servlets and JavaServer Pages by Marty Hall, ISBN
0-13-067614-1, also by Prentice Hall PTR.
Java Servlet Programming, Second Edition by Jason Hunter and William
Crawford, ISBN 0596000405, from O'Reilly.
18.11
E XERCISES
1. Modify the BudgetPro servlet so that it responds differently for the
doGet() and doPost() methods. Have doPost() continue to work as
is, but have doGet() report the number of different users and the number
of accounts that they have created. (You may need to “instrument” the
code—that is, add additional statements—to start counting such things.)
2. Change BudgetPro to do its output on the fly instead of building the entire
page before output. Can you notice any difference in the display time?
3. Design error handling for BudgetPro to prevent the user from allocating
more than is available in the (sub)account. Will you use Java exceptions?
If so, which object will throw them and which will catch them? How will
you inform the user of the error? Implement your design.
3. http://java.sun.com/j2ee/1.4/docs/api/
Search WWH ::




Custom Search