Class JKErrorServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.jk.web.servlets.JKErrorServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class JKErrorServlet extends jakarta.servlet.http.HttpServlet
This class is a servlet responsible for handling and displaying error pages and exception details.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Represents the contents of the error page as XHTML.

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    This method handles GET requests for error pages, displaying exception and error details.

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, 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

    • ERROR_PAGE_CONTENTS

      public static final String ERROR_PAGE_CONTENTS
      Represents the contents of the error page as XHTML.
  • Constructor Details

    • JKErrorServlet

      public JKErrorServlet()
  • Method Details

    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      This method handles GET requests for error pages, displaying exception and error details.
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Parameters:
      request - Specifies the HttpServletRequest for the error request.
      response - Specifies the HttpServletResponse for the error response.
      Throws:
      IOException - if an input or output error is detected when the servlet handles the GET request.
      jakarta.servlet.ServletException - if the request for the GET could not be handled.