【问题标题】:ServletRegistrationBean cannot be resolved in SpringBootServletRegistrationBean 在 Spring Boot 中无法解析
【发布时间】:2017-09-20 08:57:31
【问题描述】:

我在一个基于

的 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>

我将 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>

拥有最后一个版本,但之后我无法再编译项目,因为我遇到了这个问题:

The import org.springframework.boot.context.embedded.ServletRegistrationBean cannot be 
 resolved

【问题讨论】:

    标签: spring maven spring-mvc spring-boot spring-tool-suite


    【解决方案1】:

    解决了!

    org.springframework.boot.context.embedded.ServletRegistrationBean 在 1.4 中被弃用,取而代之的是 org.springframework.boot.web.servlet.ServletRegistrationBean。前者在 1.5 中被删除,因为它已被弃用

    【讨论】:

      猜你喜欢
      • 2018-02-10
      • 1970-01-01
      • 1970-01-01
      • 2017-08-11
      • 2019-06-11
      • 2019-08-31
      • 2021-03-31
      • 1970-01-01
      • 2014-08-27
      相关资源
      最近更新 更多