package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Servlet that builds the HTML form that gathers input * for the search engine servlet. This servlet first * displays a textfield for the search query, then looks up * the search engine names known to SearchUtilities and * displays a list of radio buttons, one for each search * engine. *
* 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 SearchEngineForm extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String title = "One-Stop Web Search!"; String actionURL = "coreservlets.SearchEngines"; String docType = "\n"; out.println (docType + "\n" + "