Class Default404Servlet

  • All Implemented Interfaces:
    DynamicServlet, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class Default404Servlet
    extends javax.servlet.http.HttpServlet
    implements DynamicServlet
    This servlet simply returns HttpServletResponse.SC_NOT_FOUND to any request. It is similar to/copied from ServletHandler.Default404Servlet.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Default404Servlet()
      Creates a new servlet simply returning HttpServletResponse.SC_NOT_FOUND to any request.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doGet​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      String getServletName()
      Gets the name of the servlet.
      void servletDeployed​(javax.servlet.ServletContext context, String urlPattern)
      Notifies the servlet that it has been deployed with the designated context and the designated pattern.
      void servletUndeployed​(javax.servlet.ServletContext context)
      Notifies the servlet that it has been undeployed.
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log
      • Methods inherited from interface javax.servlet.Servlet

        destroy, getServletConfig, getServletInfo, init, service
    • Constructor Detail

      • Default404Servlet

        public Default404Servlet()
        Creates a new servlet simply returning HttpServletResponse.SC_NOT_FOUND to any request.
    • Method Detail

      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • getServletName

        public String getServletName()
        Description copied from interface: DynamicServlet
        Gets the name of the servlet. Note that usually the servlet implementations rely on the servlet configuration to provide a name. However, when using a DynamicServlet, the servlet name has to be provided explicitly.
        Specified by:
        getServletName in interface DynamicServlet
        Specified by:
        getServletName in interface javax.servlet.ServletConfig
        Overrides:
        getServletName in class javax.servlet.GenericServlet
        Returns:
        The name of the servlet.
      • servletDeployed

        public void servletDeployed​(javax.servlet.ServletContext context,
                                    String urlPattern)
        Description copied from interface: DynamicServlet
        Notifies the servlet that it has been deployed with the designated context and the designated pattern. Note that the servlet usually will not have been initialised yet.
        Specified by:
        servletDeployed in interface DynamicServlet
        Parameters:
        context - The servlet context of this servlet.
        urlPattern - The URL pattern (mapping) this servlet has been deployed with.
      • servletUndeployed

        public void servletUndeployed​(javax.servlet.ServletContext context)
        Description copied from interface: DynamicServlet
        Notifies the servlet that it has been undeployed.
        Specified by:
        servletUndeployed in interface DynamicServlet
        Parameters:
        context - The servlet context of this servlet.