idea创建springboot的helloworld项目

项目环境:

  idea2019.3

  jdk1.8

  springboot2.2.4

  maven3.6.1(注意配置国内镜像)

1.new project

2.添加依赖

3.目录结构

4.创建controller包并创建HelloController类,编写类内容

@Controller
public class HelloController {
    @RequestMapping("/")
    public String hello(){
        return "index";
    }
}  

5. 在thymeleaf下创建index.html

6.运行程序,浏览器访问localhost:8080

7.完成!

猜你喜欢

转载自www.cnblogs.com/hellomingsheng/p/12355089.html