Sams Teach Yourself J2EE™ in 21 Days
by Martin Bond, Dan Haywood, Debbie Law, Andy Longshaw, Peter Roxburgh
Exercises
To extend your knowledge of Servlets, try the following exercise.
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.
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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access