Configuration File Example
Below is a simple context web.xml file that demonstrates all of the basic elements discussed in this chapter:
*definition of a servlet, a filter that processes requests for the servlet, and a listener
*initiation parameters
*error page definition
*session configuration
*URL mapping
Each of these items is described in detail in the remainder of this chapter.
<!-- Define and map a servlet -->
<param-value>Hello, World!</param-value>
<!-- Define and map a filter -->
<!-- Define a listener -->
<!-- Define an error-page for code 404, File Not Found -->
<!-- Define a 10 minute session timeout -->
A production application generally has a more elaborate configuration file. A file can contain any number of servlet, filter, and listener declarations. A file may contain one session-config element, and one error-page element for each HTTP error code.