17.2. A Multisystem Search Engine Front End
In Section 6.3 (A Front End to Various Search Engines), the SearchSpec class (Listing 6.2) was used by a servlet to generate the specific URLs needed to redirect requests to various different search engines. The SearchSpec class can be used by applets as well. Listing 17.1 shows an applet that creates a textfield to gather user input. When the user submits the data, the applet URL-encodes the textfield value and generates three distinct URLs with embedded GET data: one each for the Google, Infoseek, and Lycos search engines. The applet then uses showDocument to instruct the browser to display the results of those URLs in three different frame cells. The results are shown in Figures 17-1 and 17-2. HTML ...
Get Core Servlets and JavaServer Pages™ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.