UIRootFromServletContext manages the current UIRoot object in a Jetty ContextHandler.

UIRootFromServletContext uses its canonical name for the context attribute that is used to set or get the current UIRoot object (in Jetty’s ContextHandler).

ContextHandler is the environment for multiple Jetty Handlers, e.g. URI context path, class loader, static resource base.

In essence, UIRootFromServletContext is simply a "bridge" between two worlds, Spark’s UIRoot and Jetty’s ContextHandler.

setUiRoot Method

setUiRoot(contextHandler: ContextHandler, uiRoot: UIRoot): Unit


setUiRoot is used exclusively when ApiRootResource is requested to register /api/* context handler.

getUiRoot Method

getUiRoot(context: ServletContext): UIRoot


getUiRoot is used exclusively when ApiRequestContext is requested for the current UIRoot.