Class DefaultErrorHandlerServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class DefaultErrorHandlerServlet
    extends javax.servlet.GenericServlet
    The DefaultErrorHandlerServlet This is the default error handler servlet registered at the end of the global search path
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultErrorHandlerServlet

        public DefaultErrorHandlerServlet()
    • Method Detail

      • service

        public void service​(javax.servlet.ServletRequest req,
                            javax.servlet.ServletResponse res)
                     throws IOException
        Specified by:
        service in interface javax.servlet.Servlet
        Specified by:
        service in class javax.servlet.GenericServlet
        Throws:
        IOException
      • renderHtml

        protected void renderHtml​(javax.servlet.ServletRequest req,
                                  javax.servlet.ServletResponse res,
                                  String statusMessage,
                                  String requestUri,
                                  String servletName,
                                  int statusCode)
                           throws IOException
        Render the error as html
        Throws:
        IOException
      • renderJson

        protected void renderJson​(javax.servlet.ServletRequest req,
                                  javax.servlet.ServletResponse res,
                                  String statusMessage,
                                  String requestUri,
                                  String servletName,
                                  int statusCode)
                           throws IOException
        Render the error as json
        Throws:
        IOException
      • statusToString

        public static String statusToString​(int statusCode)