Class SpaNotFoundHandlerRegistry

java.lang.Object
com.kingsrook.qqq.middleware.javalin.routeproviders.SpaNotFoundHandlerRegistry

public class SpaNotFoundHandlerRegistry extends Object
Path-scoped SPA 404 handlers owned by one Javalin configuration. A single error handler delegates by longest matching prefix, with root last. Javalin app data keeps unrelated servers and their handler lists isolated.
  • Method Details

    • getInstance

      public static SpaNotFoundHandlerRegistry getInstance(io.javalin.config.JavalinConfig config)
      Get this configuration's registry and install its error handler once. Called during Javalin configuration, before the server accepts requests.
    • registerSpaHandler

      public void registerSpaHandler(String spaPath, Consumer<io.javalin.http.Context> handler)
      Register a path-scoped 404 handler
      Parameters:
      spaPath - The base path for this SPA (e.g., "/admin", "/")
      handler - The handler function to call when a 404 occurs under this path
    • clear

      public void clear()
      Clear all registered handlers (useful for testing) The configuration keeps its registered error handler. Other servers' registries are unaffected.