Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » servlets » [javadoc | source]
org.apache.catalina.servlets
public class: DefaultServlet [javadoc | source]
java.lang.Object
   javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
         org.apache.catalina.servlets.DefaultServlet

All Implemented Interfaces:
    Serializable, Servlet, ServletConfig

Direct Known Subclasses:
    WebdavServlet, RuntimeWebdavServlet

The default resource-serving servlet for most web applications, used to serve static resources such as HTML pages and images.
Nested Class Summary:
protected class  DefaultServlet.Range   
Field Summary
protected  int debug    The debugging detail level for this servlet. 
protected  int input    The input buffer size to use when serving resources. 
protected  boolean listings    Should we generate directory listings? 
protected  boolean readOnly    Read only flag. By default, it's set to true. 
protected  int output    The output buffer size to use when serving resources. 
protected static  URLEncoder urlEncoder    Array containing the safe characters set. 
protected  String localXsltFile    Allow customized directory listing per directory. 
protected  String globalXsltFile    Allow customized directory listing per instance. 
protected  String readmeFile    Allow a readme file to be included. 
protected  ProxyDirContext resources    Proxy directory context. 
protected  String fileEncoding    File encoding to be used when reading static files. If none is specified the platform default is used. 
protected  int sendfileSize    Minimum size for sendfile usage in bytes. 
protected static  ArrayList FULL    Full range marker. 
protected static final  String mimeSeparation    MIME multipart separation string 
protected static final  String RESOURCES_JNDI_NAME    JNDI resources name. 
protected static  StringManager sm    The string manager for this package. 
protected static final  int BUFFER_SIZE    Size of file transfer buffer in bytes. 
Method from org.apache.catalina.servlets.DefaultServlet Summary:
checkIfHeaders,   checkIfMatch,   checkIfModifiedSince,   checkIfNoneMatch,   checkIfUnmodifiedSince,   checkSendfile,   copy,   copy,   copy,   copy,   copy,   copy,   copyRange,   copyRange,   copyRange,   copyRange,   destroy,   displaySize,   doDelete,   doGet,   doHead,   doPost,   doPut,   executePartialPut,   findXsltInputStream,   getETag,   getReadme,   getRelativePath,   init,   parseContentRange,   parseRange,   render,   renderHtml,   renderSize,   renderXml,   rewriteUrl,   serveResource
Methods from javax.servlet.http.HttpServlet:
service
Methods from javax.servlet.GenericServlet:
destroy,   getInitParameter,   getInitParameterNames,   getServletConfig,   getServletContext,   getServletInfo,   getServletName,   init,   init,   log,   log,   service
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.servlets.DefaultServlet Detail:
 protected boolean checkIfHeaders(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Check if the conditions specified in the optional If headers are satisfied.
 protected boolean checkIfMatch(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Check if the if-match condition is satisfied.
 protected boolean checkIfModifiedSince(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Check if the if-modified-since condition is satisfied.
 protected boolean checkIfNoneMatch(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Check if the if-none-match condition is satisfied.
 protected boolean checkIfUnmodifiedSince(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Check if the if-unmodified-since condition is satisfied.
 protected boolean checkSendfile(HttpServletRequest request,
    HttpServletResponse response,
    CacheEntry entry,
    long length,
    DefaultServlet.Range range) 
    Check if sendfile can be used.
 protected  void copy(CacheEntry cacheEntry,
    InputStream is,
    ServletOutputStream ostream) throws IOException 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected  void copy(CacheEntry cacheEntry,
    InputStream is,
    PrintWriter writer) throws IOException 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected  void copy(CacheEntry cacheEntry,
    ServletOutputStream ostream,
    DefaultServlet.Range range) throws IOException 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected  void copy(CacheEntry cacheEntry,
    PrintWriter writer,
    DefaultServlet.Range range) throws IOException 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected  void copy(CacheEntry cacheEntry,
    ServletOutputStream ostream,
    Iterator ranges,
    String contentType) throws IOException 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected  void copy(CacheEntry cacheEntry,
    PrintWriter writer,
    Iterator ranges,
    String contentType) throws IOException 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected IOException copyRange(InputStream istream,
    ServletOutputStream ostream) 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected IOException copyRange(Reader reader,
    PrintWriter writer) 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected IOException copyRange(InputStream istream,
    ServletOutputStream ostream,
    long start,
    long end) 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 protected IOException copyRange(Reader reader,
    PrintWriter writer,
    long start,
    long end) 
    Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
 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) throws IOException, ServletException 
    Process a POST request for the specified resource.
 protected  void doGet(HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException 
    Process a GET request for the specified resource.
 protected  void doHead(HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException 
    Process a HEAD request for the specified resource.
 protected  void doPost(HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException 
    Process a POST request for the specified resource.
 protected  void doPut(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    Process a POST request for the specified resource.
 protected File executePartialPut(HttpServletRequest req,
    DefaultServlet.Range range,
    String path) throws IOException 
    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.
 protected InputStream findXsltInputStream(DirContext directory) throws IOException, ServletException 
    Return the xsl template inputstream (if possible)
 protected String getETag(ResourceAttributes resourceAttributes) 
    Get the ETag associated with a file.
 protected String getReadme(DirContext directory) throws IOException, ServletException 
    Get the readme file as a string.
 protected String getRelativePath(HttpServletRequest request) 
    Return the relative path associated with this servlet.
 public  void init() throws ServletException 
    Initialize this servlet.
 protected DefaultServlet.Range parseContentRange(HttpServletRequest request,
    HttpServletResponse response) throws IOException 
    Parse the content-range header.
 protected ArrayList parseRange(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Parse the range header.
 protected InputStream render(String contextPath,
    CacheEntry cacheEntry) throws IOException, ServletException 
    Decide which way to render. HTML or XML.
 protected InputStream renderHtml(String contextPath,
    CacheEntry cacheEntry) throws IOException, ServletException 
    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 InputStream renderXml(String contextPath,
    CacheEntry cacheEntry,
    InputStream xsltInputStream) throws IOException, ServletException 
    Return an InputStream to an HTML representation of the contents of this directory.
 protected String rewriteUrl(String path) 
    URL rewriter.
 protected  void serveResource(HttpServletRequest request,
    HttpServletResponse response,
    boolean content) throws IOException, ServletException 
    Serve the specified resource, optionally including the data content.