

The purpose of the Default Servlet is to serve static resources of a web application in response to client requests. As the name implies, it is generally configured as the "default" servlet for a web application, by being mapped to a URL pattern "/".
The following external specifications have provisions which partially define the correct behavior of the default servlet:
The implementation of this functionality shall conform to the following requirements:
getServletContext().log() method.The following environmental dependencies must be met in order for the default servlet to operate correctly:
$CATALINA_BASE/conf/web.xml) using a "default servlet"
servlet mapping, signified by URL pattern "/".Correct operation of the default servlet depends on the following specific features of the surrounding container:
javax.naming.directory.DirContext
implementation representing the static resources of this
web application.The following processing must be performed when the init()
method of the default servlet is called:
For all HTTP request methods, the resource path is determined from
the path information provided to this request, either as request attribute
javax.servlet.include.path_info (for a request dispatcher
access to a static resource) or by calling
request.getPathInfo() directly.
On each HTTP DELETE request processed by this servlet, the following processing shall be performed:
/META-INF
or /WEB-INF, return HTTP status 403 (forbidden).On each HTTP GET request processed by this servlet, the following processing shall be performed:
/META-INF or
/WEB-INF, return HTTP status 404 (not found).If-Range
header, perform the processing described in the HTTP/1.1 specification
to determine whether the client's information is up to date.text/html.If-Range and Range headers.ETag
header in the response, with the value calculated based on the content
of the directory.Last-Modified header in the response documenting
the date/time that the resource was last modified.On each HTTP HEAD request processed by this servlet, the following processing shall be performed:
On each HTTP POST request processed by this servlet, the following processing shall be performed:
On each HTTP PUT request processed by this servlet, the following processing shall be performed:
/META-INF
or /WEB-INF, return HTTP status 403 (forbidden).No specific processing is required when the destroy()
method is called:
In addition to the assertions implied by the functionality requirements listed above, the following additional assertions shall be tested to validate the behavior of the default servlet: