org.mortbay.jetty.servlet
Class Default

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.mortbay.jetty.servlet.Default
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig

public class Default
extends HttpServlet

The default servlet. This servlet, normally mapped to /, provides the handling for static content, OPTION and TRACE methods for the context. The following initParameters are supported:

                                                                      
   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.        
                                                                      
   putAllowed       If true, the PUT method is allowed                
                                                                      
   delAllowed       If true, the DELETE method is allowed

   redirectWelcome  If true, welcome files are redirected rather than
                    forwarded to.

   minGzipLength    If set to a positive integer, then static content
                    larger than this 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.
 
The MOVE method is allowed if PUT and DELETE are allowed

Version:
$Id: Default.java,v 1.27.2.7 2004/04/05 20:36:23 gregwilkins Exp $
Author:
Greg Wilkins (gregw)
See Also:
Serialized Form

Constructor Summary
Default()
           
 
Method Summary
 void handleDelete(HttpServletRequest request, HttpServletResponse response, java.lang.String pathInContext, Resource resource)
           
 void handleGet(HttpServletRequest request, HttpServletResponse response, java.lang.String pathInContext, Resource resource, boolean endsWithSlash)
           
 void handleMove(HttpServletRequest request, HttpServletResponse response, java.lang.String pathInContext, Resource resource)
           
 void handleOptions(HttpServletRequest request, HttpServletResponse response)
           
 void handlePut(HttpServletRequest request, HttpServletResponse response, java.lang.String pathInContext, Resource resource)
           
 void init()
          A convenience method which can be overridden so that there's no need to call super.init(config).
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Default

public Default()
Method Detail

init

public void init()
          throws UnavailableException
Description copied from class: GenericServlet
A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding GenericServlet.init(ServletConfig), simply override this method and it will be called by GenericServlet.init(ServletConfig config). The ServletConfig object can still be retrieved via GenericServlet.getServletConfig().

Overrides:
init in class GenericServlet
UnavailableException

handleGet

public void handleGet(HttpServletRequest request,
                      HttpServletResponse response,
                      java.lang.String pathInContext,
                      Resource resource,
                      boolean endsWithSlash)
               throws ServletException,
                      java.io.IOException
ServletException
java.io.IOException

handlePut

public void handlePut(HttpServletRequest request,
                      HttpServletResponse response,
                      java.lang.String pathInContext,
                      Resource resource)
               throws ServletException,
                      java.io.IOException
ServletException
java.io.IOException

handleDelete

public void handleDelete(HttpServletRequest request,
                         HttpServletResponse response,
                         java.lang.String pathInContext,
                         Resource resource)
                  throws ServletException,
                         java.io.IOException
ServletException
java.io.IOException

handleMove

public void handleMove(HttpServletRequest request,
                       HttpServletResponse response,
                       java.lang.String pathInContext,
                       Resource resource)
                throws ServletException,
                       java.io.IOException
ServletException
java.io.IOException

handleOptions

public void handleOptions(HttpServletRequest request,
                          HttpServletResponse response)
                   throws java.io.IOException
java.io.IOException


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.