package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import coreservlets.beans.*; /** Example of simplified form processing. Illustrates the * use of BeanUtilities.populateBean to automatically fill * in a bean (Java object with methods that follow the * get/set naming convention) from request parameters. *

* Taken from Core Servlets and JavaServer Pages 2nd Edition * from Prentice Hall and Sun Microsystems Press, * http://www.coreservlets.com/. * © 2003 Marty Hall; may be freely used or adapted. */ public class SubmitInsuranceInfo extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InsuranceInfo info = new InsuranceInfo(); BeanUtilities.populateBean(info, request); response.setContentType("text/html"); PrintWriter out = response.getWriter(); String docType = "\n"; String title = "Insurance Info for " + info.getName(); out.println(docType + "\n" + "" + title + "\n" + "\n" + "

\n" + "

" + title + "

\n" + "
"); } }