The ServletExample1 Class: The web.xml File

As defined by the Java servlet specification, the web.xml file contains configuration information for a servlet context, or what is also referred to as a Web application. In this example, the web.xml file is used to store the initialization parameters used by the servlet, specifically the XSLT stylesheet and the query to execute. The partial contents of this file are shown below.

Annotated web.xml File with Parameters
 <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <context-param> <param-name>Query1</param-name> <param-value>select knowledge_base.doc_key, base_doc_key, ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software 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.