While HttpHandler has a simple goal to abstract the use of different HTTP servers, the WebHandler API aims to provide a broader set of features commonly used in web applications such as:
同时 HttpHandLer 有一个简单的目标来抽象不同HTTP服务器的使用 WebHandLer API旨在提供Web应用程序中常用的更广泛的功能集 例如:
HttpHandler 对http请求处理的抽象
- 1 WebExceptionHandler 异常处理
- 2 multiple WebFilter 做过滤,可以实现各种功能,比如日志、权限等
- 3 a single WebHandler 具体的业务处理
- 4 multiple WebFilter 做过滤,可以实现各种功能,比如日志、权限等
- webSessionManager session管理
- serverCodecConfigurer 编解码
- Encoder
- Decoder
- localeContextResolver 本地化
- forwardedHeaderTransformer header的传递
- DataBuffer
- Logging
- DispatcherHandler 分发器,比较灵活,可以支持不同工作模式
- HandlerMapping Map a request to a handler.
- HandlerAdapter (异常包装)(return HandlerResult)Help the DispatcherHandler to invoke a handler mapped to a request regardless of how the handler is actually invoked
- HandlerResultHandler Process the result from the handler invocation and finalize the response.
- ResponseEntityResultHandler 0
- ServerResponseResultHandler 0
- ResponseBodyResultHandler 100
- ViewResolutionResultHandler MAX_VALUE
WebFlux结构
于 2024-06-24 10:20:48 首次发布