springboot-1-hello

创建springboot项目

1、使用网站https://start.spring.io/

springboot-1-hello_ide

2、IDEA内部集成上方网站创建

springboot-1-hello_其他_02

项目编辑

1、controller,dao,pojo,service包在Application类同级目录下创建

springboot-1-hello_其他_03

2、controller编写


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class helloController {

  @RequestMapping("/hello")
  public String hello(){
      return "helloworld";
  }
}

3、banner.txt更改启动图案

springboot-1-hello_其他_04

4、application.properties更改配置属性

springboot-1-hello_其他_05

5、使用Application类启动

springboot-1-hello_其他_06

6、启动完成

springboot-1-hello_ide_07springboot-1-hello_ide_08