Spring Boot入门一:在Eclipse中使用Spring boot
2024-10-18 19:28:34
1.安装插件
打开Eclipse-Help-Eclipse Marketplace-搜索spring tools,找到对应工具安装
下载完成后,重启eclipse,选择新建project-spring-spring start project,新建Spring boot 项目。
选择web选项
如果pom文件没有web依赖,需要加入:
<dependency>
<groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId>
</dependency>
建议测试类:
运行DemoApplication类,选择Spring Boot App
输入网址http://127.0.0.1:8080/hi,即可访问,开发非常快速。
修改访问端口和默认路径
- 在这里我们使用更加好看的application.yml方式配置。只需要将默认的application.properties替换为application.yml即可。
- 在yml添加以下代码,修改端口为8081,后缀添加路径为/test
server.port=8081
server.servlet.context-path=/test
最新文章
- python之GUI编程(二)win10 64位 pygame的安装
- Python学习01 Hello World
- git 使用钩子直接推送到工作目录
- Linux日常使用指令大全
- 理解KMP
- iOS 进阶 第十一天(0411)
- 实现CCLayer只显示一个矩形可见区域
- YII中引用自定义类
- 用CSS3写的钟表
- IE9下报错,错误: “JSON”未定义
- Objective-C马路成魔【12-分类和协议】
- 第三方推送 JPush 配置中的引入so库问题
- git commit -m 提交的内容换行
- [springMvc] 源码分析笔记(二)
- socket编程(C++)
- Codefoces 277 E. Binary Tree on Plane
- centos7 tar.xz格式文件的解压方法
- docker 报ls: cannot open directory software/: Permission denied
- oracle使用(1)
- git五分钟教程
热门文章
- RFC2616-HTTP1.1-Header Field Definitions(头字段规定部分—单词注释版)
- 英语口语练习系列-C23-运动
- python3.6.5 + selenium +VS Code 运行报错:Unable to find a matching set of capabilities的解决
- [P1020]导弹拦截 (贪心/DP/二分/单调队列)
- 使用log
- yii2 数据库和ActiveRecord
- html页面布局之table布局:
- IO流(5)—缓冲流
- Aizu2249 Road Construction(dijkstra优化+思路 好题)
- HTML5 学习05—— 拖放(Drag 和 Drop)