O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required