springboot
如何创建springboot:记得选择spring web
maven:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
直接继承父类的方法,版本啥的都在父类中,父类中还有一个父类
以后再看一遍吧,我是很明白
<!--springboot启动项-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!--springboot web搭载了tomcat,xml....-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
还有好玩的springboot banner:
在 resources中整一个banner.txt
_.-.
/ 99\
( `\
|\\ , ,|
__ | \\____/
,.--"`-.". / `---'
_.-' '-/ |
_.-" | '-. |_/_
,__.-' _,.--\ \ (( /-\
',_..--' `\ \ \\_ /
`-, ) |\'
| |-.,,-" (
| | `\ `',_
) \ \,(\(\-'
jgs \ `-,_
\_(\-(\`-`
" "
Rex by Joan Stark
启动的时候就直接是个小恐龙,啊哈哈巨好玩
原理:
自动配置:
核心依赖在父工程中
启动器:
本身的启动器,web启动器,text启动器
springboot将
主程序:
@SpringBootApplication是一个spring应用
一个启动

浙公网安备 33010602011771号