按照教程,写了个最简单的 HelloWorld,尼玛报错 -->Whitelabel Error Page 404.

网上99%都是项目结构不对,说什么 Application放在父级 package。然而我这个这么简单居然也报404。

初学 Spring boot 报错 Whitelabel Error Page 404

注意: 前端模版用templates的话,必须引入 thymeleaf依赖。

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

后来找到  spring boot初学hello world访问templates报Whitelabel Error Page 404 ,这位小哥的是 maven 引入出错,然后我想起来前两天同事刚把 maven 仓库的密码改掉。尼玛。。。搞了大半天。

解决方法就是:(针对我的情况)

  1. 首先改掉 maven 仓库密码。
  2. 再把项目pom.xml中配置的jar注释掉刷新,然后再去掉注释再右键maven->Reimport,即可以重新构建项目!

相关文章:

  • 2021-11-11
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-11-12
  • 2021-10-11
  • 2022-01-15
猜你喜欢
  • 2021-04-23
  • 2021-08-15
  • 2021-10-14
  • 2021-11-24
  • 2021-08-09
  • 2021-05-20
相关资源
相似解决方案