nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
入门资料中文文档官方文档中文文档社区嘿嘿
阅读全文
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
微服务于微服务架构微服务强调服务的大小,他关注某一个点,一个模块只做一种事情微服务架构通常而言,他提倡将单一的程序划分为一组小的服务,每个服务运行在独立的进程中,采用轻量级的通信机制 doubbo是rpc,springcloud是restful
阅读全文
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
如何编写理清依赖自动配置@Configuration 指定这个是配置类@ConditionalOnxxx 在某些条件下才生效@AutoConfigureAfter 指定自动配置类的顺序@Bean 给IOC加组件@ConfiguretionProperties 结合相关的xxxProperties配置类来绑定配置@EnableConfigurationProperties 让xxxProperties生效加入到容器中讲自动配置类配置在META-INF/spring.factories中
阅读全文
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
启动配置原理几个重要的事件回调机制
ApplicationContextInitializer
SpringApplicationRunListener
ApplicationRunner
CommandLineRunner
启动流程1return new SpringApplication(primarySources).run(args);
创建SpringApplication对象
运行run方法
创建对象现在左边的参数是null
123456789101112public SpringApplication(Class<?>... primarySources) { this(null, primarySources);}public SpringApplication(ResourceLoader resourceLoader, Class<?>... primarySources) { this.resourceLoader = resourceLoader; Assert.notNull(primarySources, "PrimarySources must not be null"); this.primarySources = new LinkedHashSet<>(Arrays.asList(primarySources)); this.webApplicationType = WebApplicationType.deduceFromClasspath(); setInitializers((Collection) getSpringFactoriesInstances(ApplicationContextInitializer.class)); setListeners((Collection) getSpringFactoriesInstances(ApplicationListener.class)); this.mainApplicationClass = deduceMainApplicationClass();}
阅读全文
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
创建项目选择MySQL+JDBC+Web
链接数据库123456spring: datasource: username: root password: 123456 url: jdbc:mysql://localhost:3306/jdbc driver-class-name: com.mysql.jdbc.Driver
阅读全文
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
整合
创建数据库
导入依赖
建立基本结构和配置框架
编写MyBatis.xml
编写Spring-dao.xml
编写Spring-service.xml
编写web.xml
编写Spring-mvc.xml
编写applicationContext.xml
阅读全文