maven实现springboot-mybatis框架(1)
创建maven的web项目,得到基本项目架构。
先贴出最后成果图
1、创建入口类:
SpringBootApplication注解是EnableAutoConfiguration、ComponentScan和Configuration三个注解的合计。
EnableAutoConfiguration :让SpringBoot根据所声明的依赖对spring框架进行自动配置
ComponentScan:扫描所有组件(@Controller @Service @Repository @Component @Mapper)
Configuration:指出该类是Bean配置的信息源
2、编写controller层、service层、mapper层、pojo层