server library

Jetleaf Web Server sub-library

This sub-library defines the server-side request processing infrastructure of the jetleaf_web package.

Importing package:jetleaf_web/server.dart exposes the components involved in handling HTTP requests on the server, including dispatchers, routing, handler mappings and adapters, method argument resolution, return value handling, content negotiation, exception handling, filters, multipart support, and core server request/response abstractions.

This library represents the central execution pipeline used to receive, route, invoke, and render server-side web requests.

Classes

AbstractAnnotatedHandlerMapping
A specialized HandlerMapping implementation that discovers and registers annotated controller methods from the JetLeaf ApplicationContext.
AbstractFrameworkHandlerMapping
A specialized AbstractAnnotatedHandlerMapping that registers JetLeaf framework-specific routes and endpoints.
AbstractHandlerMapping
Base class for JetLeaf handler mappings that associate request paths with handler methods.
AbstractRouteDslHandlerMapping
A specialized AbstractFrameworkHandlerMapping that supports JetLeaf Route DSL (Domain-Specific Language) for defining routes programmatically.
AbstractServerDispatcher
A base implementation of ServerDispatcher providing the full orchestration pipeline for handling HTTP requests in the JetLeaf framework.
AbstractUrlHandlerAdapter
Abstract base implementation of HandlerAdapter for URL-based handler methods.
AbstractWebViewAnnotatedHandlerMapping
Base class for annotation-based handler mappings that discover and register @WebView-annotated controller components in the JetLeaf web framework.
AcceptHeaderNegotiationStrategy
Default ContentNegotiationStrategy implementation that negotiates content type based on the client's Accept header.
AnnotatedHandlerAdapter
Adapter that supports annotation-based controller handlers.
AnnotatedHandlerMethod
Represents a handler method discovered through annotations such as @RequestMapping, @GetMapping, or @PostMapping.
AnnotatedMethodArgumentResolver
Resolves parameters of handler methods annotated with request parameter annotations in JetLeaf's web request handling system.
ConfigurableServerDispatcher
Defines a configurable contract for server dispatchers that support dynamic handler registration and fallback routing behavior.
ContentNegotiationResolver
Abstract interface for resolving content negotiation and setting response headers automatically for all return value handlers.
ContentNegotiationStrategy
Abstract strategy for determining the appropriate MediaType to use when writing HTTP response bodies.
ControllerExceptionHandler
A centralized exception handler for JetLeaf web controllers, responsible for transforming framework-level and domain-specific exceptions into structured, framework-consistent View responses.
DefaultContentNegotiationResolver
Default implementation of ContentNegotiationResolver that automatically resolves and sets response content type using discoverable strategies.
DefaultHandlerArgumentContext
Default in-memory implementation of HandlerArgumentContext.
DefaultMethodArgumentResolverManager
Composite implementation of MethodArgumentResolver that delegates to a chain of registered resolvers.
DefaultReturnValueHandlerManager
Central orchestrator that coordinates multiple ReturnValueHandler implementations within JetLeaf’s MVC layer.
DELETE
Represents an HTTP DELETE route.
ExceptionAdviser
Internal representation of a @ControllerAdvice or @RestControllerAdvice declaration in JetLeaf.
ExceptionResolver
Strategy interface for resolving exceptions that occur during HTTP request processing.
ExceptionResolverManager
Central registry and lifecycle coordinator for all ExceptionResolver instances in the JetLeaf web framework.
Filter
Represents a component that can intercept and manipulate HTTP requests and responses as they flow through the application.
FilterChain
Represents a chain of filters through which an HTTP request and response pass before reaching the final handler.
FilterManager
Central registry and lifecycle manager for all Filter components within the JetLeaf web framework.
FrameworkHandlerAdapter
Adapter responsible for handling Jetleaf's internal framework routes.
FrameworkHandlerMethod
A lightweight HandlerMethod representing a framework-provided route.
FrameworkMethodArgumentResolver
Core JetLeaf argument resolver that provides built-in support for resolving framework-level types such as ServerHttpRequest, ServerHttpResponse, RequestHttpBody, and ViewContext.
GET
Represents an HTTP GET route.
GlobalServerDispatcher
A central dispatcher for handling HTTP requests within a web application.
HandlerAdapter
Defines the contract for all handler adapters within the Jetleaf Web framework.
HandlerAdapterManager
Central registry and lifecycle coordinator for all HandlerAdapter instances in the JetLeaf web framework.
HandlerArgumentContext
Defines the contract for a handler execution context, which stores and provides access to method invocation data within the JetLeaf request-handling pipeline.
HandlerInterceptor
Defines a contract for intercepting requests before and after they are handled by a HandlerMethod.
HandlerInterceptorManager
Central registry and lifecycle manager for all HandlerInterceptor instances within the JetLeaf web runtime.
HandlerMapping
Strategy interface for mapping incoming HTTP requests to HandlerMethods.
HandlerMethod
Contract for all invocable handler methods in the Jetleaf web framework.
Represents an HTTP HEAD route.
HtmlExceptionResolver
Resolves exceptions using @ControllerAdvice, annotated pods.
JsonReturnValueHandler
JetLeaf’s ReturnValueHandler implementation that handles JSON-serializable controller return values.
MethodArgumentResolver
Strategy interface for resolving method parameters of a HandlerMethod.
MethodArgumentResolverManager
Central coordination interface for resolving method arguments in annotated controller or handler methods.
MethodExceptionAdviser
A reflection-based adviser that discovers and resolves exception-handling methods declared inside a JetLeaf @ControllerAdvice class.
MultipartFile
Represents a file uploaded via a multipart/form-data HTTP request.
MultipartResolver
Defines a strategy for handling multipart HTTP requests, commonly used for form submissions that include file uploads (multipart/form-data).
MultipartServerHttpRequest
Represents an HTTP request with multipart/form-data content, typically used for file uploads.
OncePerRequestFilter
A specialized Filter that guarantees execution only once per request.
OPTIONS
Represents an HTTP OPTIONS route.
PageViewReturnValueHandler
Handles controller method return values of type PageView for rendering template-based web pages with advanced features like redirect fallbacks.
Part
A single component of a multipart/form-data request, representing either a simple form field or a file upload.
PATCH
Represents an HTTP PATCH route.
POST
Represents an HTTP POST route.
PUT
Represents an HTTP PUT route.
RedirectReturnValueHandler
JetLeaf’s built-in ReturnValueHandler implementation responsible for processing redirect-based return values from controller methods.
RequestAndResponseRouterHandler
A concrete RouterHandler for routes that operate on both ServerHttpRequest and ServerHttpResponse.
RequestOnlyRouterHandler
A concrete RouterHandler for routes that operate only on ServerHttpRequest.
RequestRouteEntry
Represents a RouteEntry whose handler accepts only a ServerHttpRequest.
ResponseBodyReturnValueHandler
JetLeaf’s ReturnValueHandler responsible for processing controller methods that return a ResponseBody instance.
RestControllerExceptionHandler
A centralized exception handling component for RESTful controllers in the JetLeaf Web framework.
RestExceptionResolver
Resolves exceptions using @RestControllerAdvice annotated pods.
ReturnValueHandler
Strategy interface for handling the return value of a JetLeaf controller method invocation.
ReturnValueHandlerManager
Central coordination interface for managing and delegating method return value handling within the JetLeaf web framework.
Route
Represents a single HTTP route definition consisting of a path and an HttpMethod.
RouteDefinition
A concrete route declaration produced by a Router or its builder.
RouteDslHandlerAdapter
Adapter that supports Jetleaf’s DSL-based routing system.
RouteDslHandlerMethod
A HandlerMethod implementation representing a route defined via the Route DSL.
RouteEntry
Represents a single registered route entry within a Router.
Router
Defines the core contract for JetLeaf’s routing system.
RouterBuilder
Default implementation of the Router interface for JetLeaf.
RouteRegistryHandlerMapping
The central HandlerMapping implementation that manages and resolves all route handler registrations within JetLeaf’s web framework.
RouterHandler
A unified routing contract that abstracts over different styles of route handler functions in the JetLeaf web framework.
RouterRegistrar
Defines a contract for components that contribute routers to the application’s routing system.
RouterRegistry
A central registry for collecting and organizing Router instances during application initialization.
RouterSpec
A compiled router specification containing all resolved RouteDefinitions.
ServerDispatcher
A generic HTTP request dispatcher in the JetLeaf framework.
ServerDispatcherErrorListener
A listener interface for handling uncaught or propagated errors occurring within the JetLeaf server dispatch lifecycle.
ServerHttpRequest
An abstract interface representing an HTTP request on the server side.
ServerHttpResponse
A generic abstraction representing an HTTP response within the JetLeaf framework.
StringReturnValueHandler
JetLeaf’s ReturnValueHandler responsible for handling controller methods that return plain string content.
ViewNameReturnValueHandler
Resolves controller method return values that are strings representing view names and renders them using the JTL template engine with asset-based template resolution.
VoidReturnValueHandler
JetLeaf’s ReturnValueHandler implementation for controller methods that return void or produce no response body.
WebViewHandlerAdapter
Adapter responsible for invoking WebViewHandlerMethod instances within the JetLeaf web request processing pipeline.
WebViewHandlerMethod
Represents a handler method discovered through annotations such as @RequestMapping, @GetMapping, or @PostMapping.
XmlReturnValueHandler
ReturnValueHandler implementation that handles XML-serializable controller return values.
XRouteEntry
Represents a RouteEntry whose handler accepts both a ServerHttpRequest and a ServerHttpResponse.
YamlReturnValueHandler
ReturnValueHandler implementation that handles YAML-serializable controller return values.

Functions

delete(String path, RequestRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
deleteX(String path, XRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
get(String path, RequestRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
getX(String path, XRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
patch(String path, RequestRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
patchX(String path, XRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
post(String path, RequestRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
postX(String path, XRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
put(String path, RequestRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.
putX(String path, XRouterFunction handler) RouterBuilder
JetLeaf's Routing DSL provides a concise, functional way to create and register HTTP routes without explicitly instantiating Route or calling RouterBuilder.route manually.

Typedefs

RequestRouterFunction = FutureOr<Object?> Function(ServerHttpRequest request)
A function signature for routes that accept only the ServerHttpRequest.
XRouterFunction = FutureOr<Object?> Function(ServerHttpRequest request, ServerHttpResponse response)
A function signature for routes that operate on both the ServerHttpRequest and ServerHttpResponse.