Springboot
时间:2020-08-26 17:08:16
收藏:0
阅读:60
1、application.properties中写入:
#更改项目的端口号
server.port=8081
2、更改springboot启动图:resources新建banner.txt,百度搜索spring baner

3、springboot自动装配原理:

4、配置文件推荐使用yaml:格式:
key:空格value
#普通的
name: wangliu
#对象
student:
name: wangliu
age: 11
#数组
pets:
- dog
- cat
或
pets: [cat,dog]
5、使用yaml给pojo类赋值
①resources中建yaml文件

②yaml内:

③pojo类添加注解:

④测试:

评论(0)