天天看点

使用IDEA快速创建Spring Boot项目(直接上图)

1、创建Spring Initializr ——选中JDK版本——Next

使用IDEA快速创建Spring Boot项目(直接上图)

2、填写需要的配置信息——Next

使用IDEA快速创建Spring Boot项目(直接上图)

3、选择自己需要的功能模块——Next

使用IDEA快速创建Spring Boot项目(直接上图)

4、直接点击Finish完成

使用IDEA快速创建Spring Boot项目(直接上图)

5、创建一个Control类HelloController

@RestController
public class HelloController {

    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "Hello wrold!";
    }

}
}
           

5、启动springboot已经为我们生成好了的主程序SpringBootPro01Application

@SpringBootApplication
public class SpringBootPro01Application {

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

           

6、地址栏输入localhost:8080/hello

使用IDEA快速创建Spring Boot项目(直接上图)