Interface Middleware.Next

Enclosing interface:
Middleware

public static interface Middleware.Next
The rest of a middleware chain for one request. Valid only during the middleware call that received it, on the request's thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    run()
    Runs the remaining middleware and the handler.
  • Method Details

    • run

      Response run() throws Exception
      Runs the remaining middleware and the handler. The handler's result is returned as a Response mapped as for handlers (text, bytes, null as 204, the context status); values for a codec, such as ctx.json(value), are still unencoded: encoding and the Accept check run once after the whole chain.
      Returns:
      the response of the rest of the chain
      Throws:
      Exception - whatever the rest of the chain throws
      IllegalStateException - if called a second time, after the middleware returned, or from a thread other than the request's