zoukankan      html  css  js  c++  java
  • @SpringBootApplication注解

    一、安全机制屏蔽

    在使用 SpringBoot + Activiti 时,启动服务访问模块时,浏览器会弹出一个登录界面。

    这是因为Activiti 框架整合了SpringSecurity框架,如果我们不需要安全验证时可以禁用springsecurity。

      @SpringBootApplication(exclude={SecurityAutoConfiguration.class,ManagementWebSecurityAutoConfiguration.class},

    scanBasePackages={"com.boctech.rdop.devresource","com.boctech.rdop.devapi"})

    二、@SpringBootApplication

      @SpringBootApplication = (默认属性)@Configuration + @EnableAutoConfiguration + @ComponentScan。

      1.@Configuration:提到@Configuration就要提到他的搭档@Bean。使用这两个注解就可以创建一个简单的spring配置类,可以用来替代相应的xml配置文件。

      @Configuration的注解类标识这个类可以使用Spring IoC容器作为bean定义的来源。@Bean注解告诉Spring,一个带有@Bean的注解方法将返回一个对象,该对象应该被注册为在Spring应用程序上下文中的bean。

      2.@EnableAutoConfiguration:能够自动配置spring的上下文,试图猜测和配置你想要的bean类,通常会自动根据你的类路径和你的bean定义自动配置。

      把 spring-boot-autoconfigure.jar/META-INF/spring.factories中每一个xxxAutoConfiguration文件都加载到容器中

      3.@ComponentScan:会自动扫描指定包下的全部标有@Component的类,并注册成bean,当然包括@Component下的子注解@Service,@Repository,@Controller。

  • 相关阅读:
    sql server 的存储过程
    vue SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    数据结构 基本概念和术语
    vue v-show指令
    vue v-model :
    vue 指令
    vue 挂载点 实例 模板
    vue(1) 第一个例子
    【BZOJ1150】[CTSC2007]数据备份Backup 双向链表+堆(模拟费用流)
    【BZOJ1109】[POI2007]堆积木Klo 二维偏序
  • 原文地址:https://www.cnblogs.com/daichunchun/p/15009387.html
Copyright © 2011-2022 走看看