SpringBoot入门HelloWorld
Idea new一个项目:
1.
2.
3.
4.
5.完成基本创建,创建controller层代码
package com.comtroller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class TestController { @RequestMapping("/test") public @ResponseBody String test(){ return "Hello SpringBoot"; } }
6.运行:http://localhost:8080/test