Spring Boot 2.0.0.RELEASE中的ServerRequest

问题描述 投票:0回答:1

我最近搬了我的应用程序。从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 spring-mvc spring-boot reactive-programming
1个回答
3
投票

Spring Boot Reactive Project spring-boot-web-reactive与Spring 5.0合并为Spring Webflux

确保你的类路径上有webflux Starter:

<dependency>
     <groupId>org.springframework</groupId>
     <artifactId>spring-webflux</artifactId>
</dependency>
© www.soinside.com 2019 - 2024. All rights reserved.