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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.