8.6. A Customized Search Engine Interface
Listing 8.5 shows the CustomizedSearchEngines servlet, a variation of the SearchEngines example previously shown in Section 6.3. Like the SearchEngines servlet (see Figure 8-5), the CustomizedSearchEngines servlet reads the user choices from the HTML front end and forwards them to the appropriate search engine. In addition, the CustomizedSearchEngines servlet returns to the client cookies that store the search values. Then, when the user comes back to the front-end servlet at a later time (even after quitting the browser and restarting), the front-end page is initialized with the values from the previous search.