spring - 在 Spring Boot 2.0.6 中无法识别 Thymeleaf
问题描述
我在 pom.xml 中遇到了这个奇怪的错误
我不明白为什么我不能阅读 localhost:8080 网址。这很奇怪。
这是我的控制器
@Controller
public class IndexController {
@RequestMapping({"","/","index"})
public String getIndexPage(){
return "index";
}
}
还有我的 index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Recipes Page</title>
<h1>Recipes Index Page</h1>
</head>
<body>
</body>
</html>
为什么会这样?
解决方案
在 POM.xml 中添加以下依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
请查看以下应用程序:
推荐阅读
- android - 如何对齐两个缩放图像的底部?
- php - 为什么当我尝试使用 laravel 和 spatie stripe webhooks packge 处理条带事件时出现错误 404?
- python - Pygame掩码与组中精灵的碰撞问题
- r - R中的转置和填充NA
- python - 如何避免 tensorflow 循环中的操作过多?
- python-3.x - 如何将列表列表传递给期望 *iterables 的函数
- html - Web-scraping 脚本中 RStudio 中的错误不一致:“参数暗示不同的行数:31、30”
- apache-spark - 导出火花逻辑/物理计划?
- odoo - 如何在 saleorder formview odoo 上隐藏侧边栏?
- c++ - 如何将信号转发到私有信号?