21.2. A Multisystem Search Engine Front End

Listing 21.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. HTML forms cannot be used for this application since a form can submit its data to only a single URL. Listing 21.2 shows the SearchSpec class used by the applet to generate the specific URLs needed to redirect requests to various search engines. The SearchSpec class can also be used by servlets, as discussed in ...

Get Core Web Programming, Second Edition 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.