我最近移动了我的应用。从Spring Boot 1到Spring Boot 2(2.0.0.Release(。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
我想导入类org.springframework.web.reactive.function.server.ServerRequest
以从接口获取错误属性
org.springframework.boot.web.reactive.error.ErrorAttributes;
但是我有一个错误:
The import org.springframework.web.reactive.function.server.ServerRequest cannot be resolved
Spring Boot反应性项目spring-boot-web-reactive
与Spring 5.0
请确保您的类路径上有webflux
入门器:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
</dependency>