我已经使用Spring Initializer、embedded Tomcat、Thymeleaf template engine和包作为一个可执行的JAR文件生成了一个Spring应用程序。
所使用的技术:
Spring Boot 2.0.0.M6,Java 8,maven
但是即使我在我的pom.xml中也有这种依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>我在我的项目中得到了这个编译错误:
The import org.springframework.boot.autoconfigure.web.ErrorAttributes cannot be resolved
The import org.springframework.boot.autoconfigure.web.ErrorController cannot be resolved发布于 2017-11-23 11:53:43
最新版本的spring引导不包含这个jars.Can,您可以执行Ctrl+Shift+T,然后检查这个类是否存在
发布于 2018-07-17 11:24:59
尝试从
org.springframework.boot.web.servlet.error.ErrorController
对于ErrorAttributes
导入org.springframework.boot.web.servlet.error.ErrorAttributes;
https://stackoverflow.com/questions/47454526
复制相似问题