Servlet Development Guide : PART IV Appendices : Appendix B Configuration Quick Reference : Context web.xml
Context web.xml
This section contains a quick reference to the elements in a HydraExpress web application configuration file.
Table 8 describes the root element of the configuration file.
Table 8 – Context web.xml root element 
Element
Contains
Description
web-app
(context-param)
(listener)
(error-page)
(filter)
(filter-mapping)
(servlet)
(servlet-mapping)
(session-config)
(mime-mapping)
Root element for a configuration file. All other elements in a configuration file are contained within the web-app element.
Table 9 describes context parameters.
Table 9 – Context parameter elements 
Element
Contains
Description
context-param
param-name
param-value
Root element for a context parameter.
param-name
Name
Contains the name of the parameter.
param-value
Value
Contains the value of the parameter.
Table 10 describes the elements that configure a listener.
Table 10 – Listener elements 
Element
Contains
Description
listener
listener-class
Root element for a listener.
listener-class
dllName.createFunction
Load information for the listener. The dllName component is the name of the DLL or shared library that contains the compiled listener. The createFunction component is the name of the function the servlet container calls to construct an instance of the listener.
Table 11 describes the elements that configure an error page.
Table 11 – Error-page elements 
Element
Contains
Description
error-page
error-code
location
Defines a static page for the servlet container to return to the client when the server returns an error.
error-code
HttpErrorCode
Contains the numeric HTTP error code this error-page element applies to. For example, 500 specifies that the error-page handles internal server errors.
location
PathToFile or FileURL
Contains the location of the error-page. For example, /500error.htm declares that the error-page is a file named 500error.htm located at the root level of the context. A value of http://otherserver/404.html declares that the document at that URL contains the error‑page.
Table 12 describes the elements that configure a filter.
Table 12 – Filter elements 
Element
Contains
Description
filter
filter-name
filter-class
(init-param)
Root element for a filter.
For a description of the init-param element, see Table 14 .
filter-name
Name
Contains the name of the filter. Other elements in the configuration file refer to the filter by name.
filter-class
dllName.createFunction
Load information for the filter. The dllName component is the name of the DLL or shared library that contains the compiled listener. The createFunction component is the name of the function the servlet container calls to construct an instance of the filter.
Table 13 describes the elements that associate a filter with a URL pattern.
Table 13 – Filter mapping elements 
Element
Contains
Description
filter-mapping
filter-name
url-pattern
Root element for a filter mapping.
filter-name
Name
Contains the name of the filter to map. The name must match a name declared within a filter element.
url-pattern
Pattern
Contains the URL pattern to associate with the filter.
Table 14 describes initialization parameters for a servlet or filter.
Table 14 – Initialization parameter elements 
Element
Contains
Description
init-param
param-name
param-value
Root element for a parameter.
param-name
Name
Contains the name of the parameter.
param-value
Value
Contains the value of the parameter.
Table 15 describes the elements that configure a servlet.
Table 15 – Servlet parameter elements 
Element
Contains
Description
servlet
servlet-name
servlet-class
(init-param)
Root element for a servlet.
Note: If the element contains the attribute single-thread=”true”, only one thread at a time will enter the servlet.
servlet-name
Name
Contains the name of the servlet. Other elements in the configuration file refer to the servlet by name.
servlet-class
dllName.createFunction
Load information for the servlet. The dllName component is the name of the DLL or shared library that contains the compiled servlet. The createFunction component is the name of the function the servlet container calls to construct an instance of the servlet.
Table 16 describes the elements that associate a servlet with a URL pattern.
Table 16 – Servlet mapping elements 
Element
Contains
Description
servlet-mapping
servlet-name
url-pattern
Root element for a servlet mapping.
servlet-name
Name
Contains the name of the servlet to map. The name must match a name declared within a servlet element.
url-pattern
Pattern
Contains the URL pattern to associate with the servlet.