I have created a Spring Boot application with Intellij. It creates a sample web application with a controller and an empty html page.
But problem is this sample application returns "Whitelabel Error Page" when I go to "http://localhost:8080/info/aa". I think It cannot find info.html file. Is there any way to fix this?
Here is sample controller;
@Controller
@RequestMapping("/info")
public class InfoController {
@RequestMapping("/aa")
public String getServerInfo(Map<String, Object> model){
model.put("message", "server info");
return "info";
}
}
My project directory;
EDIT: My html file info.html;
<!DOCTYPE html>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="en">
<head>
</head>
<body>
</body>
</html>
EDIT 2: I update my html directory to templates/info.html
DemoApplication class;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
And application.properties file is empty.


DemoApplicationclassWhitelabel Error Pagein your browser.Mapped "{[/info/aa]}" onto public java.lang.String your.package.InfoController. getServerInfo(java.util.Map<String, Object> model)