Interface RequestHandler
public interface RequestHandler
-
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(String path) Called for each request before the default class loader based resource lookup.default StringrewritePath(String path) Called for each request before resource resolution, allowing the handler to rewrite the request path.
-
Method Details
-
rewritePath
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
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.
-