diff --git a/spring/webflux/spring webflux.md b/spring/webflux/spring webflux.md index 89354a2..c69cdee 100644 --- a/spring/webflux/spring webflux.md +++ b/spring/webflux/spring webflux.md @@ -320,3 +320,127 @@ webflux应用中包含的spring configuration通常包括: - 被委托给`webHandler`的beans - 其他 +上述配置将被被`WebHttpHandlerBuilder`使用,用于构建process chain,示例如下所示: +```java +ApplicationContext context = ... +HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context).build(); +``` +上述示例中返回的handler可以和`server adapter`结合使用。 + +### DispatcherHandler委托 +`DispatcherHandler`会将请求的委托给特定的bean对象,bean对象会处理请求并且将结果渲染到response中。 + +DispatcherHandler会对如下类型的bean进行auto-detect。 + +
| Bean type | +Explanation | +
|---|---|
|
+Map a request to a handler. The mapping is based on some criteria, the details of
+ which vary by The main |
+
|
+Help the |
+
|
+Process the result from the handler invocation and finalize the response. + See Result Handling. |
+
| Result Handler Type | +Return Values | +Default Order | +
|---|---|---|
|
+
|
+0 |
+
|
+
|
+0 |
+
|
+Handle return values from |
+100 |
+
|
+
See also View Resolution. |
+
|
+