国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

第一章:SpringBoot基礎(chǔ)入門

這篇具有很好參考價值的文章主要介紹了第一章:SpringBoot基礎(chǔ)入門。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

第一章:SpringBoot基礎(chǔ)入門

1.1:Spring與SpinrBoot

  1. Spring能做什么

    • Spring的能力
      第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

    • Spring的生態(tài)

      網(wǎng)址:https://spring.io/projects/spring-boot

      覆蓋了:Web開發(fā)、數(shù)據(jù)訪問、安全控制、分布式、消息服務(wù)、移動開發(fā)、批處理等。

    • Spring5重大升級

      1. 響應(yīng)式編程
        第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

      2. 內(nèi)部源碼設(shè)計

        基于Java8的一些新特性。

  2. 為什么用SpringBoot

    ? Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run"。能快速創(chuàng)建出生產(chǎn)級別的Spring應(yīng)用。

    • SpringBoot的優(yōu)點

      1. Create stand-alone Spring applications:創(chuàng)建獨立的Spring應(yīng)用。
      2. Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files):內(nèi)嵌Web服務(wù)器。
      3. Provide opinionated 'starter' dependencies to simplify your build configuration:自動starter依賴,簡單構(gòu)建配置
      4. Automatically configure Spring and 3rd party libraries whenever possible:自動配置Spring以及第三方功能。
      5. Provide production-ready features such as metrics, health checks, and externalized configuration:提供生產(chǎn)級別的監(jiān)控、健康檢查以及外部化配置。
      6. Absolutely no code generation and no requirement for XML configuration:無代碼生成、無需編寫XML

      SpringBoot是整合Spring技術(shù)棧的一站式框架,SpringBoot是簡化Spring技術(shù)棧的快速開發(fā)腳手架。

    • SpringBoot的缺點

      1. 迭代快,需要時刻關(guān)注變化。
      2. 封裝太深,內(nèi)部原理復(fù)雜,不容易精通。
  3. 時代背景

    • 微服務(wù)

      ? James Lewis and Martin Fowler (2014) 提出微服務(wù)完整概念。https://martinfowler.com/microservices/

      ? 微服務(wù)是一種架構(gòu)風(fēng)格。一個應(yīng)用拆分為一組小型服務(wù)。每個服務(wù)運行在自己的進(jìn)程內(nèi),也就是可獨立部署和升級。服務(wù)之間使用輕量級HTTP交互。服務(wù)圍繞業(yè)務(wù)功能拆,可以由全自動部署機制獨立部署,去中心化,服務(wù)自治。服務(wù)可以使用不同的語言、不同的存儲技術(shù)。

    • 分布式
      第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

      1. 分布式的困難

        遠(yuǎn)程調(diào)用、服務(wù)發(fā)現(xiàn)、負(fù)載均衡、服務(wù)容錯、配置管理、服務(wù)監(jiān)控、鏈路追蹤、日志管理、任務(wù)調(diào)度。

      2. 分布式的解決

        SpringBoot + SpringCloud
        第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

  4. 如何學(xué)習(xí)SpringBoot

    • 官網(wǎng)文檔架構(gòu)
      第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java
      第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

      查看版本新特性:https://github.com/spring-projects/spring-boot/wiki#release-notes
      第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

1.2:SpringBoot2入門

需求:瀏覽器發(fā)送/hello請求,響應(yīng)Hello, Spring Boot 2。

  1. 創(chuàng)建maven工程

    IDEA創(chuàng)建一個新的工程boot_helloworld_01。

  2. 引入依賴

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.4.RELEASE</version>
    </parent>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
    
  3. 創(chuàng)建主程序

    package com.wang;
    
    // 主程序類。@SpringBootApplication:這是一個SpringBoot應(yīng)用
    @SpringBootApplication
    public class MainApplication {
        public static void main(String[] args) {
            SpringApplication.run(MainApplication.class, args);
        }
    }
    
  4. 編寫業(yè)務(wù)

    package com.wang.controller;
    
    @RestController
    public class HelloController {
    
        @RequestMapping("/hello")
        public String handle01() {
            return "Hello, Spring Boot 2!";
        }
    }
    
  5. 測試

    直接運行mian方法,瀏覽器訪問http://localhost:8080/hello
    第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

  6. 修改配置

    resources文件夾下創(chuàng)建application.properties文件

    server.port=8888
    

    修改了上面配置,重新啟動項目,http://localhost:8080/hello訪問成功。

  7. 簡化部署

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
    

    重新打成一個jar包在cmd窗口下也能運行。
    第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java
    第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

1.3:了解自動配置原理

  1. SpringBoot特點

    • 依賴管理

      1. 父項目做依賴管理

        幾乎聲明了所有開發(fā)中常用的依賴的版本號,自動版本仲裁機制。

        <!-- 依賴管理,自己工程引入的依賴 -->
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.3.4.RELEASE</version>
        </parent>
        
        <!-- 它的父項目 -->
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>2.3.4.RELEASE</version>
        </parent>
        
      2. 開發(fā)導(dǎo)入starter場景啟動器

        • 見到很多spring-boot-starter-**就是某種場景。

        • 只要引入starter,這個場景的所有常規(guī)需要的依賴我們都自動引入。

        • SpringBoot所有支持的場景:

          https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.build-systems.starters

        • 見到*-spring-boot-starter:第三方為我們提供的簡化開發(fā)的場景啟動器。

        • 所有場景啟動器最底層的依賴

          <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter</artifactId>
              <version>2.3.4.RELEASE</version>
              <scope>compile</scope>
          </dependency>
          
      3. 無需關(guān)注版本號,自動版本仲裁

        • 引入依賴默認(rèn)都可以不寫版本。
        • 引入非版本仲裁的jar,要寫版本號。
      4. 可以修改默認(rèn)版本

        查看spring-boot-dependencies里面規(guī)定當(dāng)前依賴的版本用的key。

        <!-- 舉例:修改mysql的版本依賴 -->
        <properties>
            <mysql.version>5.1.43</mysql.version>
        </properties>
        
    • 自動配置

      1. 自動配好Tomcat

        • 引入Tomcat依賴

          <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-tomcat</artifactId>
              <version>2.3.4.RELEASE</version>
              <scope>compile</scope>
          </dependency>
          
        • 配置Tomcat

      2. 自動配置好SpringMVC

        • 引入SpringMVC全套組件。
        • 自動配好SpringmVC常用組件(功能)。
      3. 自動配好Web常見功能

        • SpringBoot幫我們配置好了所有Web開發(fā)的場景。
      4. 默認(rèn)的包結(jié)構(gòu)

        • 主程序所在包及其下面的所有子包里面的組件都會被默認(rèn)掃描出來。

        • 無序以前的包掃描配置。

        • 想要改變掃描路徑:@SpringBootApplication(scanBasePackages = "com")或者@ComponentScan("com.wang")指定掃描路徑

          @SpringBootApplication(scanBasePackages = "com.wang")
          // 等同于
          @SpringBootConfiguration
          @EnableAutoConfiguration
          @ComponentScan("com.wang")
          
      5. 各種配置擁有默認(rèn)值

        • 默認(rèn)配置最終都是映射到某個類上。
        • 配置文件的值最終會綁定在每個類上,這個類會在容器中創(chuàng)建對象。
      6. 按需加載所有自動配置項

        • 非常多的starter。
        • 引入了哪些場景這個場景的自動配置才會開啟。
        • SpringBoot所有的自動配置功能都在spring-boot-autoconfigure包里面。
  2. 容器功能

    • 添加組件

      先創(chuàng)建兩個實體類:UserPet

      package com.wang.bean;
      
      // 用戶
      public class User {
          private String name;
          private Integer age;
          private Pet pet;
      
          // 省略空參、全參構(gòu)造、get/set方法、toString方法
      }
      
      package com.wang.bean;
      
      // 寵物
      public class Pet {
          private String name;
      
          // 省略空參、全參構(gòu)造、get/set方法、toString方法
      }
      
      1. @Configuration

        Full模式與Lite模式:

        • 配置類組件之間無依賴關(guān)系用Lite模式加速容器啟動過程,減少判斷。
        • 配置類組件之間有依賴關(guān)系,方法會被調(diào)用得到之前單實例組件,用Full模式。
        // Configuration使用示例
        package com.wang.config;
        
        // 配置類里面使用@Bean標(biāo)注在方法給容器注冊組件,默認(rèn)也是單實例的。
        // 配置類本身也是組件
        // proxyBeanMethods =  false:代理bean的方法
        	// Full(proxyBeanMethods =  true): 【保證每個@Bean方法被調(diào)用多少次返回的組件都是單實例的】
        	// Lite(proxyBeanMethods =  false): 【每個@Bean方法被調(diào)用多少次返回的組件都是新創(chuàng)建的】
        	// 組件依賴必須使用Full模式默認(rèn)。其他默認(rèn)是否Lite模式
        
        // 告訴SpringBoot這一個配置類 == 配置文件
        @Configuration(proxyBeanMethods =  false)
        public class MyConfig {
        
            // 給容器中添加組件。以方法名作為組件的id。返回類型就是組件類型。返回的值,就是組件在容器中的實例
            @Bean
            public User user01() {
                User zhangsan =  new User("zhangsan", 18);
                // User組件依賴了Pet組件
                zhangsan.setPet(tomcatPet());
                return zhangsan;
            }
        
            @Bean("tom")
            public Pet tomcatPet() {
                return new Pet("tomcat");
            }
        }
        
        // Configuration測試代碼
        package com.wang;
        
        @SpringBootApplication
        public class MainApplication {
        
            public static void main(String[] args) {
                // 1. 返回我們IOC容器
                ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);
                
                // 2. 查看容器里面的組件
                String[] names = run.getBeanDefinitionNames();
                for (String name: names) {
                    System.out.println(name);
                }
        
                // 3.從容器中獲取組件
                Pet tom01 = run.getBean("tom", Pet.class);
                Pet tom02 = run.getBean("tom", Pet.class);
                System.out.println("組件:" + (tom01 == tom02));
                MyConfig bean = run.getBean(MyConfig.class);
                System.out.println(bean);
                
                // 4. 組件是否單例
                User user1 = bean.user01();
                User user2 = bean.user01();
                System.out.println(user1 == user2);
        
                User user01 = run.getBean("user01", User.class);
                Pet tom = run.getBean("tom", Pet.class);
                System.out.println("用戶的寵物: " + (user01.getPet() == tom));
            }
        }
        
      2. @Import()

        @Import({User.class, DBHelper.class})給容器中自動創(chuàng)建出這兩個類型的組件、默認(rèn)組件的名字就是全類名。

      3. @Conditional

        條件裝配:滿足Conditional指定的條件,則進(jìn)行組件注入。

        // 條件轉(zhuǎn)配示例
        package com.wang.config;
        
        @Configuration
        // 容器中存在tom組件時,才給類中的bean進(jìn)行組件注入
        @ConditionalOnBean(name = "tom")
        public class MyConfig {
        
            @Bean
            public User user01() {
                User zhangsan =  new User("zhangsan", 18);
                zhangsan.setPet(tomcatPet());
                return zhangsan;
            }
        
            @Bean("tom22")
            public Pet tomcatPet() {
                return new Pet("tomcat");
            }
        }
        
        // 測試條件裝配
        package com.wang;
        
        @SpringBootApplication()
        public class MainApplication {
            public static void main(String[] args) {
                ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);
        
                boolean tom = run.containsBean("tom");
                System.out.println("容器中Tom組件:" + tom);
                boolean user01 = run.containsBean("user01");
                System.out.println("容器中user01組件:" + user01);
                boolean tom22 = run.containsBean("tom22");
                System.out.println("容器中tom22組件:" + tom22);
            }
        }
        
    • 原生配置文件引入

      1. @ImportResource

        <!--創(chuàng)建beans.xml配置文件-->
        <bean id="haha" class="com.wang.bean.User">
            <property name="name" value="zhangsan"></property>
            <property name="age" value="18"></property>
        </bean>
        
        <bean id="hehe" class="com.wang.bean.Pet">
            <property name="name" value="tomcat"></property>
        </bean>
        
        package com.wang.config;
        
        // 添加@ImportResource注解
        @ImportResource("classpath:beans.xml")
        public class MyConfig { .... }
        
        // 測試IOC容器是否存在haha和hehe組件
        package com.wang;
        
        @SpringBootApplication
        public class MainApplication {
            public static void main(String[] args) {
                ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);
        
                boolean haha = run.containsBean("haha");
                System.out.println("haha: :" + haha);
                boolean hehe = run.containsBean("hehe");
                System.out.println("hehe::" + hehe);
            }
        }
        
    • 配置綁定

      如何使用Java讀取到properties文件中的內(nèi)容,并且把它封裝到JavaBean中,以供隨時使用:

      # application.properties文件中 
      mycar.brand=BYD
      mycar.price=100000
      
      1. @ConfigurationProperties

        package com.wang.bean;
        
        // 只有在容器中的組件,才會擁有SpringBoot提供的強大功能
        @Component
        @ConfigurationProperties(prefix = "mycar")
        public class Car {
            private String brand;
            private Integer price;
        	
            // 省略get/set方法、toString方法
        }
        
      2. @EnableConfigurationProperties+@ConfigurationProperties

        package com.wang.bean;
        
        @ConfigurationProperties(prefix = "mycar")
        public class Car { ..... }
        
        package com.wang.config;
        
        @Configuration
        // 1.開啟Car配置綁定功能
        // 2.把這個Car這個組件自動注冊到容器中
        @EnableConfigurationProperties(Car.class)
        public class MyConfig { ... }
        
  3. 自動配置原理入門

    • 引導(dǎo)加載類自動配置

      @SpringBootConfiguration
      @EnableAutoConfiguration
      @ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
      		@Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })
      public @interface SpringBootApplication { ... }
      
      1. @SpringBootConfiguration

        // 代表當(dāng)前是一個配置類
        @Configuration
        public @interface SpringBootConfiguration {}
        
      2. @ComponentScan

        // 指定掃描那些注解
        @Repeatable(ComponentScans.class)
        public @interface ComponentScan { .... }
        
      3. @EnableAutoConfiguration

        @AutoConfigurationPackage
        @Import(AutoConfigurationImportSelector.class)
        public @interface EnableAutoConfiguration { ... }
        
        • @AutoConfigurationPackage

          // 利用Registrar給容器中導(dǎo)入一系列組件
          // 將指定的一個包下的所有組件導(dǎo)入進(jìn)來,MainApplication主程序所在的包下
          @Import(AutoConfigurationPackages.Registrar.class)
          public @interface AutoConfigurationPackage { .... }
          
          package org.springframework.boot.autoconfigure;
          
          public abstract class AutoConfigurationPackages {
          
              ......
              
          	/**
          	 * {@link ImportBeanDefinitionRegistrar} to store the base package from the importing
          	 * configuration.
          	 */
          	static class Registrar implements ImportBeanDefinitionRegistrar, DeterminableImports {
          
          @Override
          public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
          	register(registry, new PackageImports(metadata).getPackageNames().toArray(new String[0]));
           }
                  
          		@Override
          		public Set<Object> determineImports(AnnotationMetadata metadata) {
          			return Collections.singleton(new PackageImports(metadata));
          		}
          	}
              
              .....
          }
          

          第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

        • @Import(AutoConfigurationImportSelector.class)

          // 1.利用getAutoConfigurationEntry(annotationMetadata)給容器中批量導(dǎo)入一些組件
          // 2.調(diào)用List<String> configurations = getCandidateConfigurations(annotationMetadata, attributes)
          // 獲取到所有需要導(dǎo)入到容器中的配置類
          package org.springframework.boot.autoconfigure;
          
          public class AutoConfigurationImportSelector implements  DeferredImportSelector,
          	BeanClassLoaderAware, ResourceLoaderAware, BeanFactoryAware, EnvironmentAware, Ordered {
                  
                  ......
                  
              @Override
          	public String[] selectImports(AnnotationMetadata annotationMetadata) {
          		if (!isEnabled(annotationMetadata)) {
          			return NO_IMPORTS;
          		}
               AutoConfigurationEntry autoConfigurationEntry = getAutoConfigurationEntry(annotationMetadata);
          		return StringUtils.toStringArray(autoConfigurationEntry.getConfigurations());
          	}
                  
          protected AutoConfigurationEntry getAutoConfigurationEntry(AnnotationMetadata annotationMetadata) {
          		if (!isEnabled(annotationMetadata)) {
          			return EMPTY_ENTRY;
          		}
          		AnnotationAttributes attributes = getAttributes(annotationMetadata);
          		List<String> configurations = getCandidateConfigurations(annotationMetadata, attributes);
          		configurations = removeDuplicates(configurations);
          		Set<String> exclusions = getExclusions(annotationMetadata, attributes);
          		checkExcludedClasses(configurations, exclusions);
          		configurations.removeAll(exclusions);
          		configurations = getConfigurationClassFilter().filter(configurations);
          		fireAutoConfigurationImportEvents(configurations, exclusions);
          		return new AutoConfigurationEntry(configurations, exclusions);
          	}
                       
                  .......   
          }
          

          第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

          // 接上面的類
          protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, 
                                                            AnnotationAttributes attributes) {
          		List<String> configurations = 
                      SpringFactoriesLoader.loadFactoryNames(getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader());
          		Assert.notEmpty(configurations, 
                                  "No auto configuration classes found in META-INF/spring.factories. If you "
          				+ "are using a custom packaging, make sure that file is correct.");
          		return configurations;
          }
          
          
          
          
          // 3.利用工廠加載Map<String, List<String>> loadSpringFactories(@Nullable ClassLoader classLoader)
          // 得到所有的組件
          
          // 4.從META-INF/spring.factories位置來加載一個文件。
          // 默認(rèn)掃描我們當(dāng)前系統(tǒng)里面所有META-INF/spring.factories位置的文件。
          // spring-boot-autoconfigure-2.3.4.RELEASE.jar包里面有META-INF/spring.factories
          package org.springframework.core.io.support;
          
          public final class SpringFactoriesLoader {
              
              ....
              
              // 此方法的返回值
              public static List<String> loadFactoryNames(Class<?> factoryType, 
                                                          @Nullable ClassLoader classLoader) {
          		String factoryTypeName = factoryType.getName();
          	return loadSpringFactories(classLoader).getOrDefault(factoryTypeName, Collections.emptyList());
          	}
              
              private static Map<String, List<String>> loadSpringFactories(@Nullable ClassLoader classLoader) {
          		MultiValueMap<String, String> result = cache.get(classLoader);
          		if (result != null) {
          			return result;
          		}
          
          		try {
          			Enumeration<URL> urls = (classLoader != null ?
          					classLoader.getResources(FACTORIES_RESOURCE_LOCATION) :
          					ClassLoader.getSystemResources(FACTORIES_RESOURCE_LOCATION));
          			result = new LinkedMultiValueMap<>();
          			while (urls.hasMoreElements()) {
          				URL url = urls.nextElement();
          				UrlResource resource = new UrlResource(url);
          				Properties properties = PropertiesLoaderUtils.loadProperties(resource);
          				for (Map.Entry<?, ?> entry : properties.entrySet()) {
          					String factoryTypeName = ((String) entry.getKey()).trim();
          					for (String factoryImplementationName : StringUtils.commaDelimitedListToStringArray((String) entry.getValue())) {
          						result.add(factoryTypeName, factoryImplementationName.trim());
          					}
          				}
          			}
          			cache.put(classLoader, result);
          			return result;
          		}
          		catch (IOException ex) {
          			throw new IllegalArgumentException("Unable to load factories from location [" +
          					FACTORIES_RESOURCE_LOCATION + "]", ex);
          		}
          	}
                  
              ....
              
          }
          

          第一章:SpringBoot基礎(chǔ)入門,SpringBoot,spring boot,后端,java

    • 按需開啟自動配置項

      # 文件里面寫死了springBoot啟動就要給容器加載的所有配置類
      ....
      # Auto Configure
      org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
      org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration,\
      org.springframework.boot.autoconfigure.aop.AopAutoConfiguration,\
      org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,\
      org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration,\
      ....
      
      # 雖然我們127個場景的所有自動配置啟動的時候默認(rèn)全部加載。XxxAutoConfiguration
      # 按照條件裝配規(guī)則(@Conditional),最終會按需配置。
      
    • 總結(jié)

      // 隨便點開spring-boot-autoconfigure-2.3.4.RELEASE.jar包下XxxAutoConfiguration文件看是否配置了此組件
      @Configuration(proxyBeanMethods = false)
      @EnableConfigurationProperties(ServerProperties.class)
      @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
      @ConditionalOnClass(CharacterEncodingFilter.class)
      @ConditionalOnProperty(prefix = "server.servlet.encoding", value = "enabled", matchIfMissing = true)
      public class HttpEncodingAutoConfiguration { .... }
      
      1. SpringBoot先加載所有的自動配置類XxxAutoConfiguration。
      2. 每個自動配置類按照條件進(jìn)行生效,默認(rèn)都會綁定配置文件指定的值。XxxProperties里面拿。XxxProperties和配置文件進(jìn)行了綁定。
      3. 生效的配置類就會給容器中裝配很多組件。
      4. 只要容器中有這些組件,就相當(dāng)于這些功能就有了。
      5. 定制化配置。
        • 用戶直接自己@Bean替換底層的組件。
        • 用戶去看這個組件是獲取的配置文件什么值就去修改。

      XxxAutoConfiguration ——> 加載組件 ——> XxxProperties里面拿值 ——> application.properties修改配置

    • 最佳實踐文章來源地址http://www.zghlxwxcb.cn/news/detail-659779.html

      1. 引入場景依賴
      2. 查看自動配置了哪些(選做):配置文件中debug=true開啟自動配置報告?!?code>Negative(不生效)、Positive(生效)】
      3. 是否需要修改:參照文檔修改配置項
      4. 自動加入或者替換組件:@Bean、@Component....
      5. 自定義器XxxCustomizer

到了這里,關(guān)于第一章:SpringBoot基礎(chǔ)入門的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • SpringBoot + Vue前后端分離項目實戰(zhàn) || 二:Spring Boot后端與數(shù)據(jù)庫連接

    SpringBoot + Vue前后端分離項目實戰(zhàn) || 二:Spring Boot后端與數(shù)據(jù)庫連接

    系列文章: SpringBoot + Vue前后端分離項目實戰(zhàn) || 一:Vue前端設(shè)計 SpringBoot + Vue前后端分離項目實戰(zhàn) || 二:Spring Boot后端與數(shù)據(jù)庫連接 SpringBoot + Vue前后端分離項目實戰(zhàn) || 三:Spring Boot后端與Vue前端連接 SpringBoot + Vue前后端分離項目實戰(zhàn) || 四:用戶管理功能實現(xiàn) SpringBoot + Vue前后

    2024年02月11日
    瀏覽(54)
  • 【SpringBoot】| Spring Boot 概述和入門程序剖析

    【SpringBoot】| Spring Boot 概述和入門程序剖析

    目錄 一:Spring Boot 入門 1. Spring能做什么? 2. SpringBoot特點 3. 如何學(xué)習(xí)SpringBoot 4.?創(chuàng)建Spring Boot項目 Maven的配置 入門案例: SpringBoot中幾個重要的注解 5. 了解自動配置原理 依賴管理 自動配置 6.?SpringBoot核心配置文件 多環(huán)境測試 自定義配置 7.?SpringBoot中使用JSP(了解) 8.?S

    2024年02月06日
    瀏覽(28)
  • 【Spring Security詳解】第一章 | 概述

    【Spring Security詳解】第一章 | 概述

    從本系列開始,博主將帶來大家深入學(xué)習(xí)Spring Security。博主對該框架的看法是不但要會使用,還有能夠理解其源碼,要知其然,還要知其所以然。 相信朋友們閱讀完博主本系列全部文章之后,定會理解Spring Security,讓我們從入門、到理解、最終吊打面試官! PS:博主早在8月中

    2023年04月08日
    瀏覽(20)
  • ElasticSearch第一章(入門介紹)

    ElasticSearch第一章(入門介紹)

    ElasticSearch(彈性搜索),簡稱ES。 ES是一個分布式,RESTFul風(fēng)格的搜索和數(shù)據(jù)分析引擎 ,能夠解決不斷涌現(xiàn)出的各種用例。作為 Elastic Stack(Elastic技術(shù)棧簡稱ELK) 的核心,Elasticsearch 會集中存儲您的數(shù)據(jù),讓您飛快完成搜索,微調(diào)相關(guān)性,進(jìn)行強大的分析,并輕松縮放規(guī)模。 我

    2024年02月22日
    瀏覽(25)
  • 第一章 MATLAB入門

    MATLAB(矩陣實驗室的簡稱)是一種專業(yè)的計算機程序,用于工程科學(xué)的矩陣數(shù)學(xué)運算。但 在以后的幾年內(nèi),它逐漸發(fā)展為一種極其靈活的計算體系,用于解決各種重要的技術(shù)問題。 Matlab程序執(zhí)行MATLAB語言,并提供了一個極其廣泛的預(yù)定義函數(shù)庫,這樣就使得技術(shù)工作 變得簡

    2024年02月05日
    瀏覽(19)
  • 第一章 快速入門

    TypeScript是JavaScript的超集。 它對JS進(jìn)行了擴展,向JS中引入了類型的概念,并添加了許多新的特性。 TS代碼需要通過編譯器編譯為JS,然后再交由JS解析器執(zhí)行。 TS完全兼容JS,換言之,任何的JS代碼都可以直接當(dāng)成JS使用。 相較于JS而言,TS擁有了靜態(tài)類型,更加嚴(yán)格的語法,更

    2024年02月01日
    瀏覽(21)
  • 第一章 小程序入門

    第一章 小程序入門

    小程序的基本結(jié)構(gòu) 小程序的頁面組成部分 JSON 配置文件的作用 app.json 配置文件 project.config.json 配置文件 sitemap.json 配置文件 頁面 .json 配置文件 什么是 wxml wxml 和 html 的區(qū)別 什么是 wxss wxss 和 css 的區(qū)別 通信模型 小程序的啟動過程 頁面渲染過程 button 按鈕的基本使用 img 組件

    2024年02月08日
    瀏覽(28)
  • ChatGPT入門到高級【第一章】

    第一章:Chatgpt的起源和發(fā)展 1.1 人工智能和Chatbot的概念 1.2 Chatbot的歷史發(fā)展 1.3 機器學(xué)習(xí)技術(shù)在Chatbot中的應(yīng)用 1.4 Chatgpt的誕生和發(fā)展 第二章:Chatgpt的技術(shù)原理 2.1 自然語言處理技術(shù) 2.2 深度學(xué)習(xí)技術(shù) 2.3 Transformer模型 2.4 GPT模型 第三章:Chatgpt的應(yīng)用場景 3.1 智能客服 3.2 智能問

    2024年02月04日
    瀏覽(19)
  • 第一章 Web自動化入門

    第一章 Web自動化入門

    1、概念 由機器設(shè)備代替人工自動完成指定目標(biāo)的過程 2、優(yōu)點 減少人工勞動力 提高工作效率 產(chǎn)品規(guī)格統(tǒng)一標(biāo)準(zhǔn) 規(guī)格化(批量生產(chǎn)) 概念:讓程序代替人工去驗證系統(tǒng)功能的過程 解決-回歸測試(重點) 解決-壓力測試 解決-兼容性測試(瀏覽器、分辨率、操作系統(tǒng)) 提高測

    2024年02月07日
    瀏覽(22)
  • Linux——(第一章)Linux的入門

    VMwear workstations下載及安裝 Ubuntu server 18.04安裝 VScode下載與安裝 使用VS Code連接遠(yuǎn)程服務(wù)器 MobaXterm的下載安裝及遠(yuǎn)程連接 Filezila的下載、安裝與使用(向服務(wù)器傳輸文件) 目錄 1.概述 2.Linux和Windows的區(qū)別 3.VM的安裝與使用 ? ? ? ? Linux內(nèi)核最早由芬蘭人林納斯·托瓦茲(Linus

    2024年02月10日
    瀏覽(26)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包