I got a simple HomeController.class
:
package com.example.tacos;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HomeController {
@GetMapping("/")
public String home() {
return "home";
}
}
Also I got a template called home.html
<!DOCTYPE HTML>
<head>
<title>Getting Started: Serving Web Content</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p>Hey</p>
</body>
</html>
Anyway I'm getting 404 in the browser and IDE's telling me Cannot resolve MVC "view" as you can see on the screen
Folder Structure:
Browser:
Hi I had the same issue and I fixed it by delete the version of Thymeleaf so the pom file will be like :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With