I have this in com.tuke.doto.Controllers / RootController.java:
package com.tuke.doto.Controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class RootController {
@RequestMapping("/")
public String root() {
return "frontpage";
}
}
and I have frontpage.html in main/resources/static (I also tried to move it into main/resources/templates
When I do request on localhost:8080 I see this:
HTTP Status [404] – [Not Found]
Type Status Report
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.15
and in my console on jetbrains intellij I see this:
javax.servlet.ServletException: Circular view path [error]: would dispatch back to the current handler URL [/error] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
I've also included server.error.whitelabel.enabled=false into main/resources/application.properties
Where is the problem? Isn't that the simplest example so why it doesn't work?
EDIT maybe I should install some dependency to make it work... this is how my build.gradle looks right now:
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-websocket')
compile("org.springframework.boot:spring-boot-devtools")
testCompile('org.springframework.boot:spring-boot-starter-test')
}

server.error.whitelabel.enabled=falsedid not work. But what worked was@EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class})on the@SpringBootApplicationclass. Maybe this is because I use Spring Boot 2. This solution works when there is another error that is the problem, but since Spring MVC does not have an error page mapped, it fails with the irrelevant error message.