初学搭建spring-boot

1.工具

①eclipse + Spring Tool Suite (STS) for Eclipse插件

②spring-tool-suite-4-4.0.2.RELEASE(搜sts4官网下载)

③idea

2.new project ,选择spring -> spring starter project


spring starter project


根据自己需要的项目需求课改


可根据实际需求更改版本号和需要的依赖包,这里简单入门就只选web就好了

然后会开始自动构建项目。


可以看到,项目结构已经生成完毕

3.写一个的Controller测试

@RestController

public class TestController {

@RequestMapping("/hello")

    public String test(){

    return "hello,this is my fitst boot!";

    }

}

4.运行spring-boot的入口文件DemoApplication.java


看到这个端口号即为启动成功

5.启动浏览器访问(ip:端口号/controller定义的路径)


完!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容