无法在SpringBoot中解析ServletRegistrationBean

Nuñ*_*ada 4 spring spring-mvc maven spring-tool-suite spring-boot

我正在一个基于SpringBoot的项目中工作

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
Run Code Online (Sandbox Code Playgroud)

我更新了pom

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
Run Code Online (Sandbox Code Playgroud)

有最后一个版本,但之后我不能再编译项目因为我有这个问题:

The import org.springframework.boot.context.embedded.ServletRegistrationBean cannot be 
 resolved
Run Code Online (Sandbox Code Playgroud)

Nuñ*_*ada 8

解决了 !

org.springframework.boot.context.embedded.ServletRegistrationBean在1.4中赞成或赞成使用org.springframework.boot.web.servlet.ServletRegistrationBean.由于它被弃用,前者在1.5中删除了