public class DefaultServlet extends HttpServlet implements ResourceFactory
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.
| Constructor and Description |
|---|
DefaultServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response) |
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response) |
protected void |
doTrace(HttpServletRequest req,
HttpServletResponse resp) |
String |
getInitParameter(String name) |
Resource |
getResource(String pathInContext)
get Resource to serve.
|
void |
init() |
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 reqRanges) |
protected void |
sendDirectory(HttpServletRequest request,
HttpServletResponse response,
Resource resource,
boolean parent) |
protected void |
writeHeaders(HttpServletResponse response,
HttpContent content,
long count) |
protected void |
writeOptionHeaders(HttpFields fields) |
protected void |
writeOptionHeaders(HttpServletResponse response) |
doDelete, doHead, doOptions, doPut, getLastModified, service, servicegetInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, logpublic void init()
throws UnavailableException
init in class GenericServletUnavailableExceptionpublic String getInitParameter(String name)
getInitParameter in interface ServletConfiggetInitParameter in class GenericServletpublic Resource getResource(String pathInContext)
getResource in interface ResourceFactorypathInContext - The path to find a resource for.protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet in class HttpServletServletExceptionIOExceptionprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doPost in class HttpServletServletExceptionIOExceptionprotected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
doTrace in class HttpServletServletExceptionIOExceptionprotected boolean passConditionalHeaders(HttpServletRequest request, HttpServletResponse response, Resource resource, HttpContent content) throws IOException
IOExceptionprotected void sendDirectory(HttpServletRequest request, HttpServletResponse response, Resource resource, boolean parent) throws IOException
IOExceptionprotected void sendData(HttpServletRequest request, HttpServletResponse response, boolean include, Resource resource, HttpContent content, Enumeration reqRanges) throws IOException
IOExceptionprotected void writeHeaders(HttpServletResponse response, HttpContent content, long count) throws IOException
IOExceptionprotected void writeOptionHeaders(HttpFields fields) throws IOException
IOExceptionprotected void writeOptionHeaders(HttpServletResponse response) throws IOException
IOExceptionpublic void destroy()
destroy in interface Servletdestroy in class GenericServletCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.