idea——新建springBoot项目
-
启动idea,create new project
-
命名
-
配置导入初始maven
-
存储路径
-
测试启动
接下来创建一个测试类 ,下面是目录结构和代码 DemoApplication 这个类一定要始终放在最外层
这里大家注意一下@RestController这个注解 这个注解是@ResponseBody + @Controller的结合体
合并了他么的功能
写完测试类后大家点开 http://localhost:8080/hello 然后出现下面的界面,恭喜大家 !!!