Class DispatcherServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.dnlkk.controller.DispatcherServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable
Direct Known Subclasses:
ApiDispatcherServlet, JspDispatcherServlet

public abstract class DispatcherServlet extends jakarta.servlet.http.HttpServlet
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     
    protected final ControllerRegistry
     

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract boolean
    controllerDispatch(Method controllerEndpoint, Object controllerReturn, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    boolean
    dispatch(jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request)
     
    getEntryMapControllerFromRequest(jakarta.servlet.http.HttpServletRequest request)
     
    protected String
    getMethodPath(String controllerPath, jakarta.servlet.http.HttpServletRequest request)
     
    protected String
    getRequestMapping(Method controllerEndpoint)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, 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
  • Field Details

    • controllerRegistry

      protected final ControllerRegistry controllerRegistry
    • contextPath

      protected final String contextPath
  • Constructor Details

    • DispatcherServlet

      public DispatcherServlet()
  • Method Details

    • dispatch

      public boolean dispatch(jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request)
    • controllerDispatch

      protected abstract boolean controllerDispatch(Method controllerEndpoint, Object controllerReturn, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Throws:
      IOException
    • getRequestMapping

      protected String getRequestMapping(Method controllerEndpoint)
    • getMethodPath

      protected String getMethodPath(String controllerPath, jakarta.servlet.http.HttpServletRequest request)
    • getEntryMapControllerFromRequest

      protected Map.Entry<String,Object> getEntryMapControllerFromRequest(jakarta.servlet.http.HttpServletRequest request)