我在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>
为什么会这样?
答案 0 :(得分:0)
在POM.xml中添加以下依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
请查看以下应用程序: