O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

To extend your knowledge of Servlets, try the following exercise.

  1. Extend the Agency case study. Add a servlet that produces a page that can be used to add new customers to the database. The information you will need to collect is the applicant's name, login, and e-mail address. Use the agency.createCustomer() method to store this information in the Customer table in the database. Check that your servlet works correctly by running your AgencyTableServlet and to display the contents of the Customer table.

  2. Now add a new servlet to delete a customer. The only information you will need to obtain is the login name. Use the agency.deleteCustomer method. Again, check that your servlet works correctly by running your AgencyTableServlet.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required