Class RootHandler

  • All Implemented Interfaces:
    HttpHandler

    public class RootHandler
    extends PredicateHandler
    By default the HttpServer will use the most specific context for requests; this however causes the context / to catch all contexts without an associated handler, instead of sending a 404 or no response. This workaround will process requests at / only and send all other requests to a different handler (typically a 404 page will be set here).
    Since:
    01.00.00
    Version:
    4.4.0
    Author:
    Ktt Development
    See Also:
    SimpleHttpHandler, HttpHandler
    • Constructor Detail

      • RootHandler

        public RootHandler​(HttpHandler rootHandler,
                           HttpHandler elseHandler)
        Creates a root handler.
        Parameters:
        rootHandler - handler for the context /
        elseHandler - handler for all other contexts (typically a 404 page)
        Since:
        01.00.00
        See Also:
        SimpleHttpHandler, HttpHandler