天天看点

完整的springboot工程

spring-boot出乎意料的好用,本文给大家展示生产实践中怎么用spring-boot。

工程结构代码 收藏代码

xml代码 收藏代码

application.properties

properties代码 收藏代码

application-test.properties

application-bean.xml spring-boot追求无xml配置,但仍可以加载xml配置

index.html

html代码 收藏代码

java代码 收藏代码

注意,application类所在包及子包下的所有类默认均在componentscan非为内。

三种启动方式:

application.main()

mvn spring-boot:run

java -jar whatsmars-spring-boot.jar