1.创建独立的Spring应用程序
2.嵌入tomcat 无war
3.简化Maven配置
4.自动配置spring
5.嵌入一些管理员需要插件
6.开箱即用xml文件配置
RestController Controller 错误页 2.包含了ResponseBody
端口修改 server.port=8082 application.properties
可以直接读到这个文件 底层实现 1.spring-configuratin-modify.json
ServcerProperties=>》
连接数据库 (orm dao bean service)
1.pom.xml添加mybatis mysql 依赖
2.Mapper文件在 interface Dao上面@Mapper 在方法体上面 @select()
3.在applciation 里面配置数据库的相关信息
spring.datasource.url/username/password/dirver-class-name
@EnableAutoConfiguration
@ComponentScan(basePackeags={“com…controller”},”service”)/不加*是为了防止讲dao层扫描进
@MapperScan(basePackags=”com.dao”)
public class Application{
main{
SpringApplication.run(Application.call)
}
}
Sprng boot进行管理 management.port=8081