美文网首页
spring boot 装配模式

spring boot 装配模式

作者: 幻影翔 | 来源:发表于2019-11-24 16:03 被阅读0次

模式注解装配

  • @Controller @Service
  • @Component注解扩展
  • @Configuration

@Enable模块装配

  • 例子

    @EnableWebMVC Web MVC模块
    @EnableTransaction Management事务管理模块
    @EnableCaching Caching模块
    @EnableAutoConfiguration 自动装配模块
    @EnableManagementContext Actuator模块
    @EnableConfigServer 配置服务器模块
    
  • 自定义@Enable模块

    @Import的派生注解
    基于注解驱动实现
        可参考@EnableWebMvc注解
    基于接口驱动实现
        ImportSelector接口  条件判断注入
        参考@EnableCaching注解
    

相关文章

网友评论

      本文标题:spring boot 装配模式

      本文链接:https://www.haomeiwen.com/subject/gkulwctx.html