new-project
点击finish即可
新建TestController类
package com.example.demo.demo1017;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class TestController {
@RequestMapping("/hello")
@ResponseBody
public String hello(){
return "hello springboot!";
}
}
点击DemoApplication运行项目即可