idea:搭建的spring boot无法在localhost下显示内容

想通过springboot实现输入“http://localhost:8080/sayhello?name=自己名字”然后在网页上面显示自己的名字;

但是搭建Springboot之后输入localhost:8080仍然是404

img

这是我的project:
img

这个是index:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hello</title>
</head>
<body>
        Stephen!hello!
</body>
</html>

这个是TestApplication:


        import org.springframework.boot.SpringApplication;
        import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TestApplication {

    public static void main(String[] args) {
        SpringApplication.run(TestApplication.class, args);
    }

}

另外这个需要配置tomcat吗?

yml文件是否配置了上下文路径

application.yml的文件发出来下。看下server.port=8080 是不是这个,需要运行 com.example.test.TestApplication 的main方法。