功能: 浏览器发送hello请求,服务器接受请求并处理,响应Hello World字符串. |
1、创建一个maven工程(jar): |
2、导入Spring Boot 相关的依赖: <!-- 引用依赖的父包 --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE</version> </parent> <!-- 依赖包 --> <dependencies> <!-- spring boot需要的包 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> |
3、编写一个主程序:启动Spring Boot应用: |
4、启动程序测试: |
5、简化部署: |
感谢--尚硅谷 |