使用Spring Initializer快速创建项目
首先肯定是打开我们的IDEA的编辑器呀~
File -> New -> Project

Spring Initializr -> JDK版本 -> Next

Group -> Artifact -> Description

需要什么模块选择什么模块,我这里只选择Web功能

最后一步咯

等待模块导入完成

右击->New->Java Class


写入Controller注解


package com.wangyang.springboot01helloworldquick.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
//@ResponseBody //这个类的所有方法返回的数据直接写给浏览器(如果是对象转为json数据)
//@Controller
/**
* @RestController == @ResponseBody + @Controller
*/
@RestController
public class HelloWorld {
@RequestMapping("/hello")
public String hello() {
return "Hello World";
}
}

访问

```
resource文件中的目录结构
static: 保存所有的静态资源文件如:js,css,image;
templates: 保存所有的模板页面(SpringBoot默认jar包嵌入式的Tomcat,默认不支持JSP页面)
可使用模板引擎(freemarker,thymeleaf);
application.properties: SpringBoot应用的配置文件,可修改一些默认设置;
自动创建的目录结构

SpringBoot——IDEA使用 Spring Initializer快速创建项目【四】
原文:https://www.cnblogs.com/wangyang0210/p/11863582.html