- java.lang.Object
-
- com.kttdevelopment.simplehttpserver.handler.PredicateHandler
-
- com.kttdevelopment.simplehttpserver.handler.RootHandler
-
- All Implemented Interfaces:
HttpHandler
public class RootHandler extends PredicateHandler
By default theHttpServerwill 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:
- 02.00.00
- Author:
- Ktt Development
- See Also:
SimpleHttpHandler,HttpHandler
-
-
Constructor Summary
Constructors Constructor Description RootHandler(HttpHandler rootHandler, HttpHandler elseHandler)Creates a root handler.
-
-
-
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
-
-