import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/hello") public String hello(){ return "My First SpringBoot Demo!"; } }
如下图所示运行成功,在浏览器中打开网址http://127.0.0.1:8080/hello,出现运行项目结果,则成功创建了一个SpringBoot项目,是不是非常的简单?
原文:https://www.cnblogs.com/zoood/p/13955189.html