44import org .springframework .boot .autoconfigure .AutoConfigureBefore ;
55import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
66import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
7- import org .springframework .boot .autoconfigure .web .ResourceProperties ;
87import org .springframework .boot .autoconfigure .web .ServerProperties ;
8+ import org .springframework .boot .autoconfigure .web .WebProperties ;
99import org .springframework .boot .autoconfigure .web .reactive .WebFluxAutoConfiguration ;
1010import org .springframework .boot .context .properties .EnableConfigurationProperties ;
1111import org .springframework .boot .web .reactive .error .ErrorAttributes ;
3535@ ConditionalOnWebApplication (type = ConditionalOnWebApplication .Type .REACTIVE )
3636@ ConditionalOnClass (WebFluxConfigurer .class )
3737@ AutoConfigureBefore (WebFluxAutoConfiguration .class )
38- @ EnableConfigurationProperties ({ServerProperties .class , ResourceProperties .class })
38+ @ EnableConfigurationProperties ({ServerProperties .class , WebProperties .class })
3939public class CustomErrorWebFluxAutoConfiguration {
4040 private final ServerProperties serverProperties ;
4141
4242 private final ApplicationContext applicationContext ;
4343
44- private final ResourceProperties resourceProperties ;
44+ private final WebProperties webProperties ;
4545
4646 private final List <ViewResolver > viewResolvers ;
4747
4848 private final ServerCodecConfigurer serverCodecConfigurer ;
4949
5050 public CustomErrorWebFluxAutoConfiguration (ServerProperties serverProperties ,
51- ResourceProperties resourceProperties ,
51+ WebProperties webProperties ,
5252 ObjectProvider <List <ViewResolver >> viewResolversProvider ,
5353 ServerCodecConfigurer serverCodecConfigurer ,
5454 ApplicationContext applicationContext ) {
5555 this .serverProperties = serverProperties ;
5656 this .applicationContext = applicationContext ;
57- this .resourceProperties = resourceProperties ;
57+ this .webProperties = webProperties ;
5858 this .viewResolvers = viewResolversProvider .getIfAvailable (Collections ::emptyList );
5959 this .serverCodecConfigurer = serverCodecConfigurer ;
6060 }
@@ -64,7 +64,7 @@ public CustomErrorWebFluxAutoConfiguration(ServerProperties serverProperties,
6464 public ErrorWebExceptionHandler errorWebExceptionHandler (ErrorAttributes errorAttributes ) {
6565 JsonErrorWebExceptionHandler exceptionHandler = new JsonErrorWebExceptionHandler (
6666 errorAttributes ,
67- this .resourceProperties ,
67+ this .webProperties . getResources () ,
6868 this .serverProperties .getError (),
6969 this .applicationContext );
7070 exceptionHandler .setViewResolvers (this .viewResolvers );
0 commit comments