Class SetErrorHandler

  • All Implemented Interfaces:
    HttpHandler

    public class SetErrorHandler
    extends java.lang.Object
    implements HttpHandler
    A handler that sets response code but continues the exchange so the servlet's error page can be returned.
    Author:
    Brad Wood
    • Constructor Detail

      • SetErrorHandler

        public SetErrorHandler​(HttpHandler next,
                               int responseCode)
        Construct a new instance.
        Parameters:
        responseCode - the response code to set
    • Method Detail

      • handleRequest

        public void handleRequest​(HttpServerExchange exchange)
                           throws java.lang.Exception
        Description copied from interface: HttpHandler
        Handle the request.
        Specified by:
        handleRequest in interface HttpHandler
        Parameters:
        exchange - the HTTP request/response exchange
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object