Skip to content

Commit 53ead26

Browse files
author
zhult13
committed
升级spring-boot到2.5.14
1 parent d2d2852 commit 53ead26

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<java.version>8</java.version>
1616
<spring-cloud-alibaba-dependencies.version>2021.1</spring-cloud-alibaba-dependencies.version>
17-
<spring-boot-dependencies.version>2.5.13</spring-boot-dependencies.version>
17+
<spring-boot-dependencies.version>2.5.14</spring-boot-dependencies.version>
1818
<spring-cloud-dependencies.version>2020.0.5</spring-cloud-dependencies.version>
1919
<commons-collections4.version>4.4</commons-collections4.version>
2020
<swagger.butler.version>2.0.1</swagger.butler.version>

zlt-gateway/sc-gateway/src/main/java/com/central/gateway/error/CustomErrorWebFluxAutoConfiguration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
55
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
66
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
7-
import org.springframework.boot.autoconfigure.web.ResourceProperties;
87
import org.springframework.boot.autoconfigure.web.ServerProperties;
8+
import org.springframework.boot.autoconfigure.web.WebProperties;
99
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
1010
import org.springframework.boot.context.properties.EnableConfigurationProperties;
1111
import org.springframework.boot.web.reactive.error.ErrorAttributes;
@@ -35,26 +35,26 @@
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})
3939
public 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);

zlt-gateway/sc-gateway/src/main/java/com/central/gateway/error/JsonErrorWebExceptionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.central.gateway.error;
22

33
import org.springframework.boot.autoconfigure.web.ErrorProperties;
4-
import org.springframework.boot.autoconfigure.web.ResourceProperties;
4+
import org.springframework.boot.autoconfigure.web.WebProperties;
55
import org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler;
66
import org.springframework.boot.web.error.ErrorAttributeOptions;
77
import org.springframework.boot.web.reactive.error.ErrorAttributes;
@@ -23,7 +23,7 @@
2323
* Github: https://github.com/zlt2000
2424
*/
2525
public class JsonErrorWebExceptionHandler extends DefaultErrorWebExceptionHandler {
26-
public JsonErrorWebExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
26+
public JsonErrorWebExceptionHandler(ErrorAttributes errorAttributes, WebProperties.Resources resourceProperties,
2727
ErrorProperties errorProperties, ApplicationContext applicationContext) {
2828
super(errorAttributes, resourceProperties, errorProperties, applicationContext);
2929
}

0 commit comments

Comments
 (0)