Class HttpController

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
io.john.amiscaray.quak.web.servlet.HttpController
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class HttpController extends jakarta.servlet.http.HttpServlet
Handles all HTTP requests for a single path. Can be configured to handle any HTTP method for that path.
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpController(String urlPattern, Map<RequestMethod,PathController<?,?>> pathControllers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    service(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse)
     
    protected void
    service(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, Map<String,String> pathParameters)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service

    Methods inherited from class jakarta.servlet.GenericServlet

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

    Methods inherited from class java.lang.Object

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

    • HttpController

      public HttpController(String urlPattern, Map<RequestMethod,PathController<?,?>> pathControllers)
      Parameters:
      urlPattern - The URL pattern this controller handles.
      pathControllers - A map of HTTP methods to a corresponding handler.
  • Method Details

    • service

      protected void service(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse, Map<String,String> pathParameters) throws IOException
      Throws:
      IOException
    • service

      protected void service(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse) throws IOException
      Overrides:
      service in class jakarta.servlet.http.HttpServlet
      Throws:
      IOException