Class DefaultServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.bluezoo.gumdrop.servlet.DefaultServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class DefaultServlet extends javax.servlet.http.HttpServlet
Default servlet for a Web application. This serves resources in the servlet context.
Author:
Chris Burdess
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    protected void
    doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    protected void
    doOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    protected final String
    getPath(javax.servlet.http.HttpServletRequest request)
    Returns the complete path of the request relative to the web application root, not including any query portion.
    protected URL
    getResource(javax.servlet.http.HttpServletRequest request, String path, javax.servlet.ServletContext context)
    Returns the resource URL for the given request.
     
    protected final boolean
    Determines if the specified path refers to a static collection in the web application.
    protected final boolean
    Indicates whether the specified path refers to a file in the WEB-INF or META-INF resource hierarchies, which must result in a 404 (SRV.9.5, SRV.9.6).
    protected void
    service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doPost, doPut, doTrace, getLastModified, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultServlet

      public DefaultServlet()
  • Method Details

    • getServletName

      public String getServletName()
      Specified by:
      getServletName in interface javax.servlet.ServletConfig
      Overrides:
      getServletName in class javax.servlet.GenericServlet
    • service

      protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Overrides:
      service in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doOptions

      protected void doOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Overrides:
      doOptions in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doHead

      protected void doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Overrides:
      doHead in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doGet

      protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Overrides:
      doGet in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • getResource

      protected URL getResource(javax.servlet.http.HttpServletRequest request, String path, javax.servlet.ServletContext context) throws IOException
      Returns the resource URL for the given request.
      Throws:
      IOException
    • getPath

      protected final String getPath(javax.servlet.http.HttpServletRequest request)
      Returns the complete path of the request relative to the web application root, not including any query portion.
    • isCollection

      protected final boolean isCollection(String path)
      Determines if the specified path refers to a static collection in the web application.
    • isWebInf

      protected final boolean isWebInf(String path)
      Indicates whether the specified path refers to a file in the WEB-INF or META-INF resource hierarchies, which must result in a 404 (SRV.9.5, SRV.9.6).