点击next,填好坐标之后再点击下一步,选择spring web,会自动生成配置项
项目构建完成之后,截图如下
在java当中新建一个hello.java
输入以下代码:
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class test {
@RequestMapping("/hello")
public String hello(){
return "hello";
}
}
点击运行项目,在浏览器中输入地址localhost:8080/hello,项目运行成功



