| javax.servlet.http.HttpServlet org.apache.catalina.servlets.DefaultServlet
All known Subclasses: org.apache.catalina.servlets.WebdavServlet,
DefaultServlet | public class DefaultServlet extends HttpServlet (Code) | | The default resource-serving servlet for most web applications,
used to serve static resources such as HTML pages and images.
author: Craig R. McClanahan author: Remy Maucherat version: $Revision: 1.57 $ $Date: 2002/06/14 03:19:43 $ |
Inner Class :protected class ResourceInfo | |
Method Summary | |
protected String | appendParameters(HttpServletRequest request, String redirectPath) Append the request parameters to the redirection string before calling
sendRedirect. | protected boolean | checkIfHeaders(HttpServletRequest request, HttpServletResponse response, ResourceInfo resourceInfo) Check if the conditions specified in the optional If headers are
satisfied. | public void | destroy() Finalize this servlet. | protected void | displaySize(StringBuffer buf, int filesize) Display the size of a file. | protected void | doDelete(HttpServletRequest req, HttpServletResponse resp) Process a POST request for the specified resource. | protected void | doGet(HttpServletRequest request, HttpServletResponse response) Process a GET request for the specified resource. | protected void | doHead(HttpServletRequest request, HttpServletResponse response) Process a HEAD request for the specified resource. | protected void | doPost(HttpServletRequest request, HttpServletResponse response) Process a POST request for the specified resource. | protected void | doPut(HttpServletRequest req, HttpServletResponse resp) Process a POST request for the specified resource. | protected File | executePartialPut(HttpServletRequest req, Range range, String path) Handle a partial PUT. | protected String | getETag(ResourceInfo resourceInfo) Get the ETag associated with a file. | protected String | getRelativePath(HttpServletRequest request) Return the relative path associated with this servlet. | protected DirContext | getResources() Get resources. | public void | init() Initialize this servlet. | protected String | normalize(String path) Return a context-relative path, beginning with a "/", that represents
the canonical version of the specified path after ".." and "." elements
are resolved out. | protected Range | parseContentRange(HttpServletRequest request, HttpServletResponse response) Parse the content-range header. | protected Vector | parseRange(HttpServletRequest request, HttpServletResponse response, ResourceInfo resourceInfo) Parse the range header. | protected InputStream | render(String contextPath, ResourceInfo resourceInfo) Return an InputStream to an HTML representation of the contents
of this directory. | protected String | renderSize(long size) Render the specified file size (in bytes). | protected String | rewriteUrl(String path) URL rewriter. | protected void | serveResource(HttpServletRequest request, HttpServletResponse response, boolean content) Serve the specified resource, optionally including the data content. | protected void | showRequestInfo(HttpServletRequest req) Show HTTP header information. |
RESOURCES_JNDI_NAME | final protected static String RESOURCES_JNDI_NAME(Code) | | JNDI resources name.
|
debug | protected int debug(Code) | | The debugging detail level for this servlet.
|
formats | final protected static SimpleDateFormat formats(Code) | | The set of SimpleDateFormat formats to use in getDateHeader().
|
input | protected int input(Code) | | The input buffer size to use when serving resources.
|
listings | protected boolean listings(Code) | | Should we generate directory listings when no welcome file is present?
|
md5Encoder | final protected static MD5Encoder md5Encoder(Code) | | The MD5 helper object for this class.
|
mimeSeparation | final protected static String mimeSeparation(Code) | | MIME multipart separation string
|
output | protected int output(Code) | | The output buffer size to use when serving resources.
|
readOnly | protected boolean readOnly(Code) | | Read only flag. By default, it's set to true.
|
urlEncoder | protected static URLEncoder urlEncoder(Code) | | Array containing the safe characters set.
|
welcomes | protected String welcomes(Code) | | The set of welcome files for this web application
|
appendParameters | protected String appendParameters(HttpServletRequest request, String redirectPath)(Code) | | Append the request parameters to the redirection string before calling
sendRedirect.
|
checkIfHeaders | protected boolean checkIfHeaders(HttpServletRequest request, HttpServletResponse response, ResourceInfo resourceInfo) throws IOException(Code) | | Check if the conditions specified in the optional If headers are
satisfied.
Parameters: request - The servlet request we are processing Parameters: response - The servlet response we are creating Parameters: resourceInfo - File object boolean true if the resource meets all the specified conditions,and false if any of the conditions is not satisfied, in which caserequest processing is stopped |
destroy | public void destroy()(Code) | | Finalize this servlet.
|
displaySize | protected void displaySize(StringBuffer buf, int filesize)(Code) | | Display the size of a file.
|
executePartialPut | protected File executePartialPut(HttpServletRequest req, Range range, String path) throws IOException(Code) | | Handle a partial PUT. New content specified in request is appended to
existing content in oldRevisionContent (if present). This code does
not support simultaneous partial updates to the same resource.
|
getETag | protected String getETag(ResourceInfo resourceInfo)(Code) | | Get the ETag associated with a file.
Parameters: resourceInfo - File object Parameters: strong - True if we want a strong ETag, in which case a checksumof the file has to be calculated |
getRelativePath | protected String getRelativePath(HttpServletRequest request)(Code) | | Return the relative path associated with this servlet.
Parameters: request - The servlet request we are processing |
getResources | protected DirContext getResources()(Code) | | Get resources. This method will try to retrieve the resources through
JNDI first, then in the servlet context if JNDI has failed (it could be
disabled). It will return null.
A JNDI DirContext, or null. |
normalize | protected String normalize(String path)(Code) | | Return a context-relative path, beginning with a "/", that represents
the canonical version of the specified path after ".." and "." elements
are resolved out. If the specified path attempts to go outside the
boundaries of the current context (i.e. too many ".." path elements
are present), return null instead.
Parameters: path - Path to be normalized |
parseContentRange | protected Range parseContentRange(HttpServletRequest request, HttpServletResponse response) throws IOException(Code) | | Parse the content-range header.
Parameters: request - The servlet request we are processing Parameters: response - The servlet response we are creating Range |
parseRange | protected Vector parseRange(HttpServletRequest request, HttpServletResponse response, ResourceInfo resourceInfo) throws IOException(Code) | | Parse the range header.
Parameters: request - The servlet request we are processing Parameters: response - The servlet response we are creating Vector of ranges |
render | protected InputStream render(String contextPath, ResourceInfo resourceInfo)(Code) | | Return an InputStream to an HTML representation of the contents
of this directory.
Parameters: contextPath - Context path to which our internal paths arerelative |
renderSize | protected String renderSize(long size)(Code) | | Render the specified file size (in bytes).
Parameters: size - File size (in bytes) |
rewriteUrl | protected String rewriteUrl(String path)(Code) | | URL rewriter.
Parameters: path - Path which has to be rewiten |
serveResource | protected void serveResource(HttpServletRequest request, HttpServletResponse response, boolean content) throws IOException, ServletException(Code) | | Serve the specified resource, optionally including the data content.
Parameters: request - The servlet request we are processing Parameters: response - The servlet response we are creating Parameters: content - Should the content be included? exception: IOException - if an input/output error occurs exception: ServletException - if a servlet-specified error occurs |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|