import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
//处理请求路径为/hello的GET请求并返回一个字符串
@Controller
public class HelloController {
@GetMapping("/hello")
@ResponseBody
public String hello() {
return "hello,spring boot!";
}
}
第一个springboot程序
最新推荐文章于 2024-05-13 10:14:10 发布