acceptRanges If true, range requests and responses are
supported
dirAllowed If true, directory listings are returned if no
welcome file is found. Else 403 Forbidden.
welcomeServlets If true, attempt to dispatch to welcome files
that are servlets, but only after no matching static
resources could be found.
This must be false if you want directory listings,
but have index.jsp in your welcome file list.
redirectWelcome If true, welcome files are redirected rather than
forwarded to.
gzip If set to true, then static content will be served as
gzip content encoded if a matching resource is
found ending with ".gz"
resourceBase Set to replace the context resource base
relativeResourceBase
Set with a pathname relative to the base of the
servlet context root. Useful for only serving static content out
of only specific subdirectories.
aliases If True, aliases of resources are allowed (eg. symbolic
links and caps variations). May bypass security constraints.
maxCacheSize The maximum total size of the cache or 0 for no cache.
maxCachedFileSize The maximum size of a file to cache
maxCachedFiles The maximum number of files to cache
cacheType Set to "bio", "nio" or "both" to determine the type resource cache.
A bio cached buffer may be used by nio but is not as efficient as an
nio buffer. An nio cached buffer may not be used by bio.
useFileMappedBuffer
If set to true, it will use mapped file buffer to serve static content
when using NIO connector. Setting this value to false means that
a direct buffer will be used instead of a mapped file buffer.
By default, this is set to true.
cacheControl If set, all static content will have this value set as the cache-control
header.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private ResourceCache | |
| pack-priv ByteArrayBuffer | |
| private ContextHandler. | |
| private ServletHolder | |
| private boolean | |
| private boolean | |
| private MimeTypes | |
| private DefaultServlet. | |
| private boolean | |
| private Resource | |
| private ServletHandler | |
| private boolean | |
| private String[] | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | destroy()
Overrides javax. Implements javax. |
| protected void | doGet(HttpServletRequest
an request, HttpServletResponse HttpServletRequest object that
contains the request the client has made
of the servletan response)HttpServletResponse object that
contains the response the servlet sends
to the clientOverrides javax. service method) to
allow a servlet to handle a GET request.
|
| protected void | doPost(HttpServletRequest
an request, HttpServletResponse HttpServletRequest object that
contains the request the client has made
of the servletan response)HttpServletResponse object that
contains the response the servlet sends
to the clientOverrides javax. service method)
to allow a servlet to handle a POST request.
|
| protected void | doTrace(HttpServletRequest
the req, HttpServletResponse HttpServletRequest object that
contains the request the client made of
the servletthe resp)HttpServletResponse object that
contains the response the servlet returns
to the clientOverrides javax. service method)
to allow a servlet to handle a TRACE request.
|
| private boolean | |
| private int | |
| public String | getInitParameter(String
a name)String specifying the name
of the initialization parameterOverrides javax. Implements javax. String containing the value of the named
initialization parameter, or null if the parameter does
not exist.
|
| public Resource | Returns: The resource to serve.The path to find a resource for. pathInContext)Implements org. |
| private String | Returns: The path of the matching welcome file in contextThe path in Context in which we are looking for a welcome pathInContext)Finds a matching welcome file for the supplied |
| public void | init()
Overrides javax. super.init(config).
|
| protected boolean | passConditionalHeaders(HttpServletRequest request, HttpServletResponse response, Resource resource, HttpContent content)
|
| protected void | sendData(HttpServletRequest request, HttpServletResponse response, boolean include, Resource resource, HttpContent content, Enumeration<E> reqRanges)
|
| protected void | sendDirectory(HttpServletRequest request, HttpServletResponse response, Resource resource, boolean parent)
|
| protected void | |
| protected void | |
| protected void |
| _acceptRanges | back to summary |
|---|---|
| private boolean _acceptRanges | |
| _aliases | back to summary |
|---|---|
| private boolean _aliases | |
| _bioCache | back to summary |
|---|---|
| private ResourceCache _bioCache | |
| _cacheControl | back to summary |
|---|---|
| pack-priv ByteArrayBuffer _cacheControl | |
| _context | back to summary |
|---|---|
| private ContextHandler. | |
| _defaultHolder | back to summary |
|---|---|
| private ServletHolder _defaultHolder | |
| _dirAllowed | back to summary |
|---|---|
| private boolean _dirAllowed | |
| _gzip | back to summary |
|---|---|
| private boolean _gzip | |
| _mimeTypes | back to summary |
|---|---|
| private MimeTypes _mimeTypes | |
| _nioCache | back to summary |
|---|---|
| private DefaultServlet. | |
| _redirectWelcome | back to summary |
|---|---|
| private boolean _redirectWelcome | |
| _resourceBase | back to summary |
|---|---|
| private Resource _resourceBase | |
| _servletHandler | back to summary |
|---|---|
| private ServletHandler _servletHandler | |
| _useFileMappedBuffer | back to summary |
|---|---|
| private boolean _useFileMappedBuffer | |
| _welcomes | back to summary |
|---|---|
| private String[] _welcomes | |
| _welcomeServlets | back to summary |
|---|---|
| private boolean _welcomeServlets | |
| DefaultServlet | back to summary |
|---|---|
| public DefaultServlet() | |
| destroy | back to summary |
|---|---|
| public void destroy() Overrides javax. Implements javax. Doc from javax. Called by the servlet container to indicate to a servlet that the
servlet is being taken out of service. See | |
| doGet | back to summary |
|---|---|
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the Overriding this method to support a GET request also automatically supports an HTTP HEAD request. A HEAD request is a GET request that returns no body in the response, only the request header fields. When overriding this method, read the request data,
write the response headers, get the response's writer or
output stream object, and finally, write the response data.
It's best to include content type and encoding. When using
a The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. Where possible, set the Content-Length header (with the
When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. The GET method should be safe, that is, without any side effects for which users are held responsible. For example, most form queries have no side effects. If a client request is intended to change stored data, the request should use some other HTTP method. The GET method should also be idempotent, meaning that it can be safely repeated. Sometimes making a method safe also makes it idempotent. For example, repeating queries is both safe and idempotent, but buying a product online or modifying data is neither safe nor idempotent. If the request is incorrectly formatted,
| |
| doPost | back to summary |
|---|---|
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the When overriding this method, read the request data,
write the response headers, get the response's writer or output
stream object, and finally, write the response data. It's best
to include content type and encoding. When using a
The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. Where possible, set the Content-Length header (with the
When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. This method does not need to be either safe or idempotent. Operations requested through POST can have side effects for which the user can be held accountable, for example, updating stored data or buying items online. If the HTTP POST request is incorrectly formatted,
| |
| doTrace | back to summary |
|---|---|
| protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the
| |
| getInitBoolean | back to summary |
|---|---|
| private boolean getInitBoolean(String name, boolean dft) | |
| getInitInt | back to summary |
|---|---|
| private int getInitInt(String name, int dft) | |
| getInitParameter | back to summary |
|---|---|
| public String getInitParameter(String name) Overrides javax. Implements javax. Doc from javax. Returns a This method is supplied for convenience. It gets the
value of the named parameter from the servlet's
| |
| getResource | back to summary |
|---|---|
| public Resource getResource(String pathInContext) Implements org. get Resource to serve. Map a path to a resource. The default implementation calls HttpContext.getResource but derived servlets may provide their own mapping. | |
| getWelcomeFile | back to summary |
|---|---|
| private String getWelcomeFile(String pathInContext) throws MalformedURLException, IOException Finds a matching welcome file for the supplied | |
| init | back to summary |
|---|---|
| public void init() throws UnavailableException Overrides javax. Doc from javax. A convenience method which can be overridden so that there's no need
to call Instead of overriding | |
| passConditionalHeaders | back to summary |
|---|---|
| protected boolean passConditionalHeaders(HttpServletRequest request, HttpServletResponse response, Resource resource, HttpContent content) throws IOException | |
| sendData | back to summary |
|---|---|
| protected void sendData(HttpServletRequest request, HttpServletResponse response, boolean include, Resource resource, HttpContent content, Enumeration<E> reqRanges) throws IOException | |
| sendDirectory | back to summary |
|---|---|
| protected void sendDirectory(HttpServletRequest request, HttpServletResponse response, Resource resource, boolean parent) throws IOException | |
| writeHeaders | back to summary |
|---|---|
| protected void writeHeaders(HttpServletResponse response, HttpContent content, long count) throws IOException | |
| writeOptionHeaders | back to summary |
|---|---|
| protected void writeOptionHeaders(HttpFields fields) throws IOException | |
| writeOptionHeaders | back to summary |
|---|---|
| protected void writeOptionHeaders(HttpServletResponse response) throws IOException | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void |
| NIOResourceCache | back to summary |
|---|---|
| public NIOResourceCache(MimeTypes mimeTypes) | |
| fill | back to summary |
|---|---|
| protected void fill(ResourceCache. Overrides org. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Buffer | |
| public long | |
| public Buffer | |
| public InputStream | |
| public Buffer | |
| public Resource | |
| public void |
| _resource | back to summary |
|---|---|
| pack-priv Resource _resource | |
| UnCachedContent | back to summary |
|---|---|
| pack-priv UnCachedContent(Resource resource) | |
| getBuffer | back to summary |
|---|---|
| public Buffer getBuffer() Implements org. | |
| getContentLength | back to summary |
|---|---|
| public long getContentLength() Implements org. | |
| getContentType | back to summary |
|---|---|
| public Buffer getContentType() Implements org. | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Implements org. | |
| getLastModified | back to summary |
|---|---|
| public Buffer getLastModified() Implements org. | |
| getResource | back to summary |
|---|---|
| public Resource getResource() Implements org. | |
| release | back to summary |
|---|---|
| public void release() Implements org. | |