Class Default404Servlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
de.aristaflow.adept2.base.servletcontainer.Default404Servlet
All Implemented Interfaces:
DynamicServlet, jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class Default404Servlet extends jakarta.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:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    Gets the name of the servlet.
    void
    servletDeployed(jakarta.servlet.ServletContext context, Collection<String> urlPatterns)
    Notifies the servlet that it has been deployed with the designated context and the designated patterns.
    void
    servletUndeployed(jakarta.servlet.ServletContext context)
    Notifies the servlet that it has been undeployed.

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.Servlet

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

    • Default404Servlet

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

    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.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 jakarta.servlet.ServletConfig
      Overrides:
      getServletName in class jakarta.servlet.GenericServlet
      Returns:
      The name of the servlet.
    • servletDeployed

      public void servletDeployed(jakarta.servlet.ServletContext context, Collection<String> urlPatterns)
      Description copied from interface: DynamicServlet
      Notifies the servlet that it has been deployed with the designated context and the designated patterns. 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.
      urlPatterns - The URL patterns (mapping) this servlet has been deployed with.
    • servletUndeployed

      public void servletUndeployed(jakarta.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.