Class ConditionalHandler.NextElseReject

All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, Invocable
Enclosing class:
ConditionalHandler

public static class ConditionalHandler.NextElseReject extends ConditionalHandler

An implementation of ConditionalHandler that, if conditions are met, calls ConditionalHandler.nextHandler(Request, Response, Callback), otherwise sends an error response with a configurable HTTP status code, by default 403 (Forbidden).

Websites that want to allow only certain HTTP methods, can configure an instance of this class allowing only GET, HEAD and POST, so that other HTTP methods such as DELETE, TRACE, etc. are not allowed.

Similarly, websites can configure HTTP URI path patterns to allow or disallow specific request paths.

  • Constructor Details

    • NextElseReject

      public NextElseReject()
    • NextElseReject

      public NextElseReject(int status)
    • NextElseReject

      public NextElseReject(Handler nextHandler, int status)
    • NextElseReject

      public NextElseReject(boolean dynamic, Handler nextHandler, int status)
  • Method Details