import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@RestController
public class HelloController {
@RequestMapping(value="/hello",method=RequestMethod.GET)
public String say(){
return "Hello Spring Boot!";
}
}
第一个SpringBoot。
最新推荐文章于 2024-11-06 14:23:12 发布
本文介绍了一个简单的Spring Boot应用实例,通过创建一个名为HelloController的控制器类,并定义了一个GET请求的处理方法来返回“Hello Spring Boot!”的消息。此示例展示了如何使用Spring Boot快速搭建Web服务。
21万+

被折叠的 条评论
为什么被折叠?



