1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -93,10 +93,6 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
93
93
@ Nullable
94
94
private ApplicationContext applicationContext ;
95
95
96
- @ Nullable
97
- public final ApplicationContext getApplicationContext () {
98
- return this .applicationContext ;
99
- }
100
96
101
97
@ Override
102
98
public void setApplicationContext (@ Nullable ApplicationContext applicationContext ) {
@@ -108,6 +104,12 @@ public void setApplicationContext(@Nullable ApplicationContext applicationContex
108
104
}
109
105
}
110
106
107
+ @ Nullable
108
+ public final ApplicationContext getApplicationContext () {
109
+ return this .applicationContext ;
110
+ }
111
+
112
+
111
113
@ Bean
112
114
public DispatcherHandler webHandler () {
113
115
return new DispatcherHandler ();
@@ -122,6 +124,7 @@ public WebExceptionHandler responseStatusExceptionHandler() {
122
124
@ Bean
123
125
public RequestMappingHandlerMapping requestMappingHandlerMapping (
124
126
@ Qualifier ("webFluxContentTypeResolver" ) RequestedContentTypeResolver contentTypeResolver ) {
127
+
125
128
RequestMappingHandlerMapping mapping = createRequestMappingHandlerMapping ();
126
129
mapping .setOrder (0 );
127
130
mapping .setContentTypeResolver (contentTypeResolver );
@@ -205,7 +208,7 @@ public void configurePathMatching(PathMatchConfigurer configurer) {
205
208
@ Bean
206
209
public RouterFunctionMapping routerFunctionMapping (ServerCodecConfigurer serverCodecConfigurer ) {
207
210
RouterFunctionMapping mapping = createRouterFunctionMapping ();
208
- mapping .setOrder (-1 ); // go before RequestMappingHandlerMapping
211
+ mapping .setOrder (-1 ); // go before RequestMappingHandlerMapping
209
212
mapping .setMessageReaders (serverCodecConfigurer .getReaders ());
210
213
mapping .setCorsConfigurations (getCorsConfigurations ());
211
214
@@ -330,8 +333,8 @@ protected void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
330
333
* initializing all {@link WebDataBinder} instances.
331
334
*/
332
335
protected ConfigurableWebBindingInitializer getConfigurableWebBindingInitializer (
333
- FormattingConversionService webFluxConversionService ,
334
- Validator webFluxValidator ) {
336
+ FormattingConversionService webFluxConversionService , Validator webFluxValidator ) {
337
+
335
338
ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer ();
336
339
initializer .setConversionService (webFluxConversionService );
337
340
initializer .setValidator (webFluxValidator );
@@ -430,6 +433,7 @@ public ResponseEntityResultHandler responseEntityResultHandler(
430
433
@ Qualifier ("webFluxAdapterRegistry" ) ReactiveAdapterRegistry reactiveAdapterRegistry ,
431
434
ServerCodecConfigurer serverCodecConfigurer ,
432
435
@ Qualifier ("webFluxContentTypeResolver" ) RequestedContentTypeResolver contentTypeResolver ) {
436
+
433
437
return new ResponseEntityResultHandler (serverCodecConfigurer .getWriters (),
434
438
contentTypeResolver , reactiveAdapterRegistry );
435
439
}
@@ -439,6 +443,7 @@ public ResponseBodyResultHandler responseBodyResultHandler(
439
443
@ Qualifier ("webFluxAdapterRegistry" ) ReactiveAdapterRegistry reactiveAdapterRegistry ,
440
444
ServerCodecConfigurer serverCodecConfigurer ,
441
445
@ Qualifier ("webFluxContentTypeResolver" ) RequestedContentTypeResolver contentTypeResolver ) {
446
+
442
447
return new ResponseBodyResultHandler (serverCodecConfigurer .getWriters (),
443
448
contentTypeResolver , reactiveAdapterRegistry );
444
449
}
@@ -447,6 +452,7 @@ public ResponseBodyResultHandler responseBodyResultHandler(
447
452
public ViewResolutionResultHandler viewResolutionResultHandler (
448
453
@ Qualifier ("webFluxAdapterRegistry" ) ReactiveAdapterRegistry reactiveAdapterRegistry ,
449
454
@ Qualifier ("webFluxContentTypeResolver" ) RequestedContentTypeResolver contentTypeResolver ) {
455
+
450
456
ViewResolverRegistry registry = getViewResolverRegistry ();
451
457
List <ViewResolver > resolvers = registry .getViewResolvers ();
452
458
ViewResolutionResultHandler handler = new ViewResolutionResultHandler (
@@ -457,8 +463,7 @@ public ViewResolutionResultHandler viewResolutionResultHandler(
457
463
}
458
464
459
465
@ Bean
460
- public ServerResponseResultHandler serverResponseResultHandler (
461
- ServerCodecConfigurer serverCodecConfigurer ) {
466
+ public ServerResponseResultHandler serverResponseResultHandler (ServerCodecConfigurer serverCodecConfigurer ) {
462
467
List <ViewResolver > resolvers = getViewResolverRegistry ().getViewResolvers ();
463
468
ServerResponseResultHandler handler = new ServerResponseResultHandler ();
464
469
handler .setMessageWriters (serverCodecConfigurer .getWriters ());
0 commit comments