Class InvokerServlet

  • All Implemented Interfaces:
    jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, ContainerServlet

    public final class InvokerServlet
    extends jakarta.servlet.http.HttpServlet
    implements ContainerServlet
    The default servlet-invoking servlet for most web applications, used to serve requests to servlets that have not been registered in the web application deployment descriptor.
    Version:
    $Revision: 1.3 $ $Date: 2005/12/08 01:27:56 $
    Author:
    Craig R. McClanahan
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ResourceBundle rb  
      • Fields inherited from class jakarta.servlet.http.HttpServlet

        LEGACY_DO_HEAD
    • Constructor Summary

      Constructors 
      Constructor Description
      InvokerServlet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Finalize this servlet.
      void doGet​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Process a GET request for the specified resource.
      void doHead​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Process a HEAD request for the specified resource.
      void doPost​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Process a POST request for the specified resource.
      Wrapper getWrapper()
      Return the Wrapper with which we are associated.
      void init()
      Initialize this servlet.
      void serveRequest​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Serve the specified request, creating the corresponding response.
      void setWrapper​(Wrapper wrapper)
      Set the Wrapper with which we are associated.
      • Methods inherited from class jakarta.servlet.http.HttpServlet

        doDelete, doOptions, doPut, doTrace, getLastModified, init, service, service
      • Methods inherited from class jakarta.servlet.GenericServlet

        getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
    • Constructor Detail

      • InvokerServlet

        public InvokerServlet()
    • Method Detail

      • setWrapper

        public void setWrapper​(Wrapper wrapper)
        Set the Wrapper with which we are associated.
        Specified by:
        setWrapper in interface ContainerServlet
        Parameters:
        wrapper - The new wrapper
      • destroy

        public void destroy()
        Finalize this servlet.
        Specified by:
        destroy in interface jakarta.servlet.Servlet
        Overrides:
        destroy in class jakarta.servlet.GenericServlet
      • doGet

        public void doGet​(jakarta.servlet.http.HttpServletRequest request,
                          jakarta.servlet.http.HttpServletResponse response)
                   throws IOException,
                          jakarta.servlet.ServletException
        Process a GET request for the specified resource.
        Overrides:
        doGet in class jakarta.servlet.http.HttpServlet
        Parameters:
        request - The servlet request we are processing
        response - The servlet response we are creating
        Throws:
        IOException - if an input/output error occurs
        jakarta.servlet.ServletException - if a servlet-specified error occurs
      • doHead

        public void doHead​(jakarta.servlet.http.HttpServletRequest request,
                           jakarta.servlet.http.HttpServletResponse response)
                    throws IOException,
                           jakarta.servlet.ServletException
        Process a HEAD request for the specified resource.
        Overrides:
        doHead in class jakarta.servlet.http.HttpServlet
        Parameters:
        request - The servlet request we are processing
        response - The servlet response we are creating
        Throws:
        IOException - if an input/output error occurs
        jakarta.servlet.ServletException - if a servlet-specified error occurs
      • doPost

        public void doPost​(jakarta.servlet.http.HttpServletRequest request,
                           jakarta.servlet.http.HttpServletResponse response)
                    throws IOException,
                           jakarta.servlet.ServletException
        Process a POST request for the specified resource.
        Overrides:
        doPost in class jakarta.servlet.http.HttpServlet
        Parameters:
        request - The servlet request we are processing
        response - The servlet response we are creating
        Throws:
        IOException - if an input/output error occurs
        jakarta.servlet.ServletException - if a servlet-specified error occurs
      • init

        public void init()
                  throws jakarta.servlet.ServletException
        Initialize this servlet.
        Overrides:
        init in class jakarta.servlet.GenericServlet
        Throws:
        jakarta.servlet.ServletException
      • serveRequest

        public void serveRequest​(jakarta.servlet.http.HttpServletRequest request,
                                 jakarta.servlet.http.HttpServletResponse response)
                          throws IOException,
                                 jakarta.servlet.ServletException
        Serve the specified request, creating the corresponding response. After the first time a particular servlet class is requested, it will be served directly (like any registered servlet) because it will have been registered and mapped in our associated Context.

        Synchronize to avoid race conditions when multiple requests try to initialize the same servlet at the same time

        Parameters:
        request - The servlet request we are processing
        response - The servlet response we are creating
        Throws:
        IOException - if an input/output error occurs
        jakarta.servlet.ServletException - if a servlet-specified error occurs