Files
Hui-s-notebook/logseq-java/journals/2023_10_22.md
2024-02-02 00:12:49 +08:00

27 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- DOING SSM框架
:LOGBOOK:
CLOCK: [2023-10-22 Sun 19:56:32]
:END:
- [【冒死上传】比啃书强十倍23年最牛SSM框架面试教程SpringBoot+SpringMvc+Mybatis高质量夺命连环47问|完整版-允许白嫖_哔哩哔哩_bilibili](https://www.bilibili.com/video/BV1hh4y1q7je/)
- Spring中定义Bean的方式 #card
- 使用@Bean
- 使用@Component
- 使用@Controller@Service@Repository
- 使用@Configuration
- 使用@Import(.class)导入
- 使用@ControllerAdevice@RestControllerAdvice
- 底层不是用的Spring AOP那套Spring MVC自己实现了
- 使用BeanDefination
- xml配置\<bean/>标签
- @ImportResource(classpath:spring.xml)
- Spring的自动配置 #card
- 使用SpringBoot时会引入一个starter包间接引用spring-boot-autoconfigure的包里面有各种各样的配置类里面配置了各种Bean
- @SpringBootApplication注解,内部有三个注解
- @SpringBootConfiguration
- @EnableAutoConfiguration自动配置的开关正常情况下我们的应用程序不会扫描SpringBootConfigure这个包的路径文件开启了这个注解才会
- @ComponentScan
- 自动将第三方组件的Bean加载到IOC容器中不需要手动去写相关Bean的配置在启动类上有一个@SpringBootApplication注解,这个是一个复合注解,内部有一个@EnbaleAutoConfiguration注解第三方jar包内部的配置类就是有@Configuration注解以及@Bean注解同时在resources/META-INFO/spring.factories文件中有这些需要加载的配置类的路径
- {{embed [[#{} 与 ${} 的区别]]}}
- ApplicationContext和BeanFactory有什么区别
- 都是接口分别代表应用容器和Bean工厂
- Application继承了BeanFactory有BeanFactory的全部功能也是一个Bean工厂还继承了其它接口并增加了国际化事件发布加载资源文件获取系统环境变量等功能