Interface RequestHandler


public interface RequestHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    Called for each request before the default class loader based resource lookup.
    default String
    Called for each request before resource resolution, allowing the handler to rewrite the request path.
  • Method Details

    • rewritePath

      default String rewritePath(String path)
      Called for each request before resource resolution, allowing the handler to rewrite the request path. Rewrites of all registered handlers are chained in registration order.
      Parameters:
      path - The requested resource path (e.g. /blockly/blockly.html), potentially already rewritten by previously registered handlers.
      Returns:
      The rewritten path, or the passed path unchanged if this handler does not rewrite it.
    • handleRequest

      @Nullable InputStream handleRequest(String path) throws Exception
      Called for each request before the default class loader based resource lookup.
      Parameters:
      path - The requested resource path (e.g. /blockly/blockly.html).
      Returns:
      Stream with the resource contents, or null to pass processing back to the default handler.
      Throws:
      Exception - If the request handling fails. The request is then passed to the remaining handlers.