最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Spring Boot配置管理最佳實踐方案

 更新時間:2026年02月28日 10:07:33   作者:洋洋技術(shù)筆記  
本文將詳細(xì)介紹Spring Boot的配置管理相關(guān)內(nèi)容,包括配置優(yōu)先級、多環(huán)境管理、屬性注入、安全配置、配置校驗和熱更新等主題,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧

概述

Spring Boot提供了靈活而強(qiáng)大的配置管理機(jī)制。從啟動命令行參數(shù)到環(huán)境變量,從配置文件到代碼默認(rèn)值,Spring Boot能夠從多種來源讀取配置,并按照明確的優(yōu)先級規(guī)則進(jìn)行合并。理解這套機(jī)制,是熟練運用Spring Boot的前提。

本文將詳細(xì)介紹Spring Boot的配置管理相關(guān)內(nèi)容,包括配置優(yōu)先級、多環(huán)境管理、屬性注入、安全配置、配置校驗和熱更新等主題。

一、配置優(yōu)先級

1.1 優(yōu)先級層次

Spring Boot的配置來源眾多,當(dāng)同一配置項在多個來源中有不同值時,優(yōu)先級高的來源會覆蓋優(yōu)先級低的。以下是完整的優(yōu)先級順序(從高到低):

┌─────────────────────────────────────────────────────────────────┐
│                    配置優(yōu)先級金字塔                              │
└─────────────────────────────────────────────────────────────────┘
                    ┌─────────────┐
                    │   命令行    │  ← 最高優(yōu)先級
                    │  參數(shù)       │
                    └──────┬──────┘
                           │
              ┌────────────┴────────────┐
              │    系統(tǒng)屬性            │
              │  (System Properties)   │
              └───────────┬─────────────┘
                          │
           ┌──────────────┴──────────────┐
           │    操作系統(tǒng)環(huán)境變量         │
           │  (OS Environment Variables)│
           └──────────────┬──────────────┘
                          │
    ┌─────────────────────┴─────────────────────┐
    │           application-{profile}.yml       │
    │        (Profile-specific Config)          │
    └─────────────────────┬─────────────────────┘
                          │
    ┌─────────────────────┴─────────────────────┐
    │             application.yml               │
    │          (Application Config)              │
    └─────────────────────┬─────────────────────┘
                          │
    ┌─────────────────────┴─────────────────────┐
    │            默認(rèn)值                          │
    │        (@Default Values)                   │
    └───────────────────────────────────────────┘

1.2 優(yōu)先級詳解

優(yōu)先級配置來源說明
1命令行參數(shù)通過--key=value形式傳入
2命令行屬性通過--spring.key=value形式傳入
3JNDI屬性通過JNDI獲取
4System.getProperties()JVM系統(tǒng)屬性
5操作系統(tǒng)環(huán)境變量環(huán)境變量
6RandomValuePropertySourcerandom.*隨機(jī)值
7application-{profile}.ymlProfile特定配置
8application.yml主配置文件
9@PropertySource注解指定的配置文件
10默認(rèn)屬性代碼中的默認(rèn)值

完整優(yōu)先級:命令行參數(shù) > 命令行屬性 > SPRING_APPLICATION_JSON > RandomValuePropertySource > ServletConfig/ServletContext參數(shù) > JNDI > Java系統(tǒng)屬性 > 操作系統(tǒng)環(huán)境變量 > application-{profile}.yml > application.yml > @PropertySource > 默認(rèn)屬性

1.3 查看配置來源

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Application.class);
        ConfigurableEnvironment env = app.run(args).getEnvironment();
        System.out.println("=== 配置來源展示 ===");
        System.out.println("server.port = " + env.getProperty("server.port"));
        env.getPropertySources().forEach(ps -> {
            System.out.println("來源: " + ps.getName());
        });
    }
}

運行結(jié)果示例:

=== 配置來源展示 ===
server.port = 8081
來源: configurationProperties
來源: servletConfigInitParams
來源: servletContextInitParams
來源: systemProperties
來源: systemEnvironment
來源: random
來源: applicationConfig: [classpath:/application.yml]
來源: defaultProperties

二、多環(huán)境配置

2.1 Profile機(jī)制

Spring Boot通過Profile實現(xiàn)多環(huán)境配置。通過在application.yml中激活不同的profile,可以加載對應(yīng)的配置文件。

# application.yml - 主配置
spring:
  application:
    name: my-app
  profiles:
    active: dev  # 激活開發(fā)環(huán)境配置
server:
  port: 8080
---
# application-dev.yml - 開發(fā)環(huán)境
spring:
  config:
    activate:
      on-profile: dev
server:
  port: 8080
logging:
  level:
    root: DEBUG
---
# application-test.yml - 測試環(huán)境
spring:
  config:
    activate:
      on-profile: test
server:
  port: 8081
logging:
  level:
    root: INFO
---
# application-prod.yml - 生產(chǎn)環(huán)境
spring:
  config:
    activate:
      on-profile: prod
server:
  port: 80
logging:
  level:
    root: WARN

2.2 激活Profile的方式

方式一:配置文件激活

spring:
  profiles:
    active: prod

方式二:命令行激活

java -jar myapp.jar --spring.profiles.active=prod

方式三:環(huán)境變量激活

export SPRING_PROFILES_ACTIVE=prod
java -jar myapp.jar

方式四:代碼激活

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Application.class);
        app.setAdditionalProfiles("prod");
        app.run(args);
    }
}

2.3 激活多個Profile

可以同時激活多個Profile,它們會按順序覆蓋配置:

java -jar myapp.jar --spring.profiles.active=prod,mysql,redis

2.4 Spring Boot 2.4+ 變化

重要變化:Spring Boot 2.4版本對配置文件的加載順序進(jìn)行了調(diào)整。application-{profile}.yml不再自動覆蓋application.yml。如果需要讓profile特定文件覆蓋主文件,需要使用spring.config.import或通過命令行參數(shù)顯式指定。

三、屬性注入方式

3.1 @Value注解

@Value適用于注入單個配置項:

@Component
public class DatabaseConfig {
    @Value("${database.url}")
    private String url;
    @Value("${database.username}")
    private String username;
    @Value("${database.password}")
    private String password;
    @Value("${database.pool-size:10}")
    private int poolSize;
}

特點

  • 逐個注入,適合少量配置
  • 支持SpEL表達(dá)式
  • 支持默認(rèn)值語法${key:defaultValue}
  • 不支持松散綁定
  • 不支持復(fù)雜對象
  • 不支持配置校驗

3.2 @ConfigurationProperties

@ConfigurationProperties適用于批量綁定配置到對象:

@Component
@ConfigurationProperties(prefix = "database")
@Validated
public class DatabaseProperties {
    @NotBlank(message = "數(shù)據(jù)庫URL不能為空")
    private String url;
    @NotBlank(message = "用戶名不能為空")
    private String username;
    private String password;
    @Min(value = 1, message = "連接池大小至少為1")
    @Max(value = 100, message = "連接池大小不能超過100")
    private int poolSize = 10;
    private List<String> hosts = new ArrayList<>();
    private Map<String, String> properties = new HashMap<>();
    private Timeout timeout = new Timeout();
    @Data
    public static class Timeout {
        private Duration connection = Duration.ofSeconds(30);
        private Duration read = Duration.ofSeconds(60);
    }
}

對應(yīng)配置:

database:
  url: jdbc:mysql://localhost:3306/mydb
  username: root
  password: secret
  pool-size: 20
  hosts:
    - host1.example.com
    - host2.example.com
  properties:
    ssl: true
    timeout: 5000
  timeout:
    connection: 10s
    read: 30s

特點

  • 批量綁定,適合復(fù)雜配置對象
  • 支持松散綁定
  • 不支持SpEL表達(dá)式
  • 支持復(fù)雜嵌套對象
  • 支持JSR-303校驗
  • 支持IDE自動提示
  • 自動生成配置元數(shù)據(jù)

3.3 兩種方式對比

特性@Value@ConfigurationProperties
綁定方式逐個綁定批量綁定
松散綁定支持支持
SpEL表達(dá)式支持不支持
復(fù)雜對象不支持支持
配置校驗不支持支持
IDE提示支持
元數(shù)據(jù)生成自動生成

3.4 松散綁定

@ConfigurationProperties支持多種命名風(fēng)格自動匹配:

# 以下寫法都能綁定到 myPropertyName
my-property-name: value1
my_property_name: value2
myPropertyName: value3
MY_PROPERTY_NAME: value4
@ConfigurationProperties(prefix = "my")
public class MyProperties {
    private String propertyName;  // 都能正確綁定
}

四、敏感配置管理

4.1 環(huán)境變量方案

將敏感信息放在環(huán)境變量中,配置文件引用環(huán)境變量:

database:
  url: jdbc:mysql://${DB_HOST:localhost}:3306/${DB_NAME:mydb}
  username: ${DB_USERNAME}
  password: ${DB_PASSWORD}

部署時設(shè)置環(huán)境變量:

export DB_HOST=prod-db.example.com
export DB_NAME=production
export DB_USERNAME=admin
export DB_PASSWORD=super-secret-password

4.2 配置中心方案

對于大型項目,可以使用配置中心集中管理敏感配置:

說明:Nacos是阿里巴巴開源的配置中心,以下配置適用于Spring Cloud環(huán)境。

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
spring:
  cloud:
    nacos:
      config:
        server-addr: nacos.example.com:8848
        namespace: production
        group: DEFAULT_GROUP
        file-extension: yaml

4.3 Jasypt加密方案

使用Jasypt對配置文件中的敏感信息進(jìn)行加密:

<dependency>
    <groupId>com.github.ulisesbocchio</groupId>
    <artifactId>jasypt-spring-boot-starter</artifactId>
    <version>3.0.5</version>
</dependency>
database:
  password: ENC(G6N718UuyPE5bHyWKyuLQSm02auQPUtm)

啟動時通過系統(tǒng)屬性傳入密鑰:

java -jar myapp.jar -Djasypt.encryptor.password=secret-key

五、配置校驗

5.1 JSR-303校驗

引入驗證依賴:

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

在配置類上添加@Validated注解:

@Component
@ConfigurationProperties(prefix = "app")
@Validated
public class AppProperties {
    @NotBlank(message = "應(yīng)用名稱不能為空")
    @Size(min = 2, max = 50, message = "應(yīng)用名稱長度必須在2-50之間")
    private String name;
    @NotBlank(message = "應(yīng)用版本不能為空")
    @Pattern(regexp = "^\\d+\\.\\d+\\.\\d+$", message = "版本號格式錯誤")
    private String version;
    @Email(message = "管理員郵箱格式錯誤")
    private String adminEmail;
    @URL(message = "服務(wù)地址格式錯誤")
    private String serviceUrl;
    @Valid
    private Security security = new Security();
    @Data
    public static class Security {
        @NotBlank(message = "密鑰不能為空")
        @Size(min = 32, message = "密鑰長度不能少于32位")
        private String secretKey;
        @DurationMin(value = 1, unit = ChronoUnit.HOURS)
        @DurationMax(value = 24, unit = ChronoUnit.HOURS)
        private Duration tokenValidity = Duration.ofHours(8);
    }
}

5.2 自定義校驗注解

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = PasswordStrengthValidator.class)
public @interface StrongPassword {
    String message() default "密碼強(qiáng)度不足";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
public class PasswordStrengthValidator implements ConstraintValidator<StrongPassword, String> {
    @Override
    public boolean isValid(String password, ConstraintValidatorContext context) {
        if (password == null) return false;
        boolean hasUpper = password.chars().anyMatch(Character::isUpperCase);
        boolean hasLower = password.chars().anyMatch(Character::isLowerCase);
        boolean hasDigit = password.chars().anyMatch(Character::isDigit);
        boolean hasSpecial = password.chars().anyMatch(ch -> "!@#$%^&*".indexOf(ch) >= 0);
        return hasUpper && hasLower && hasDigit && hasSpecial && password.length() >= 8;
    }
}

六、配置熱更新

6.1 熱更新機(jī)制

對于需要運行時動態(tài)調(diào)整的配置(如功能開關(guān)、限流閾值),可以通過熱更新實現(xiàn)無需重啟應(yīng)用即可生效。

注意@RefreshScope是Spring Cloud提供的功能,需要引入Spring Cloud依賴。純Spring Boot項目可以使用Spring Boot Actuator的/actuator/refresh端點配合@ConfigurationProperties實現(xiàn)配置刷新。

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter</artifactId>
</dependency>
@Component
@RefreshScope
@ConfigurationProperties(prefix = "feature")
public class FeatureProperties {
    private boolean newUserRegistration = true;
    private boolean maintenanceMode = false;
    private int maxConnections = 100;
}

配置更新后,發(fā)送刷新請求:

curl -X POST http://localhost:8080/actuator/refresh

6.2 監(jiān)聽配置變更

@Component
public class ConfigChangeListener implements ApplicationListener<EnvironmentChangeEvent> {
    private static final Logger log = LoggerFactory.getLogger(ConfigChangeListener.class);
    @Override
    public void onApplicationEvent(EnvironmentChangeEvent event) {
        log.info("配置發(fā)生變更,影響的鍵: {}", event.getKeys());
        for (String key : event.getKeys()) {
            log.info("配置項 {} 已更新", key);
        }
    }
}

七、最佳實踐

7.1 命名規(guī)范

# 推薦:層次清晰,語義明確
app:
  database:
    mysql:
      url: jdbc:mysql://localhost:3306/mydb
      username: root
    redis:
      host: localhost
      port: 6379
# 不推薦:層次混亂,語義不清
dbUrl: jdbc:mysql://localhost:3306/mydb
redis_host: localhost
mysqlUser: root

7.2 配置分層

┌─────────────────────────────────────────────────────────────────┐
│                    配置分層架構(gòu)                                  │
└─────────────────────────────────────────────────────────────────┘
第一層:框架配置(Spring Boot默認(rèn))
        └── server.port, spring.application.name 等
第二層:中間件配置(數(shù)據(jù)庫、緩存、消息隊列)
        └── database.*, cache.*, mq.*
第三層:業(yè)務(wù)配置(業(yè)務(wù)相關(guān)參數(shù))
        └── app.feature.*, app.business.*
第四層:運維配置(監(jiān)控、日志、健康檢查)
        └── management.*, logging.*

7.3 配置文件組織

src/main/resources/
├── application.yml                    # 主配置
├── application-dev.yml                # 開發(fā)環(huán)境
├── application-test.yml               # 測試環(huán)境
├── application-prod.yml               # 生產(chǎn)環(huán)境
├── config/
│   ├── database.yml                   # 數(shù)據(jù)庫配置
│   ├── cache.yml                      # 緩存配置
│   └── security.yml                   # 安全配置
└── additional-spring-configuration-metadata.json  # 配置元數(shù)據(jù)

加載額外配置文件:

@SpringBootApplication
@PropertySource("classpath:config/database.yml")
@PropertySource("classpath:config/cache.yml")
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

7.4 配置文檔化

使用配置元數(shù)據(jù)生成IDE提示和文檔:

{
  "properties": [
    {
      "name": "app.database.url",
      "type": "java.lang.String",
      "description": "數(shù)據(jù)庫連接地址",
      "defaultValue": "jdbc:mysql://localhost:3306/mydb"
    },
    {
      "name": "app.database.pool-size",
      "type": "java.lang.Integer",
      "description": "數(shù)據(jù)庫連接池大小",
      "defaultValue": 10,
      "deprecation": {
        "reason": "請使用 app.database.hikari.maximum-pool-size 替代",
        "replacement": "app.database.hikari.maximum-pool-size"
      }
    }
  ]
}

八、常見問題與解決方案

8.1 配置不生效

問題:明明配置了,但程序讀不到。

排查方法

@Component
public class ConfigDebugger implements ApplicationRunner {
    @Autowired
    private ConfigurableEnvironment environment;
    @Override
    public void run(ApplicationArguments args) {
        String key = "your.config.key";
        System.out.println("=== 配置調(diào)試信息 ===");
        System.out.println("配置值: " + environment.getProperty(key));
        for (PropertySource<?> ps : environment.getPropertySources()) {
            if (ps.containsProperty(key)) {
                System.out.println("來源: " + ps.getName());
                System.out.println("值: " + ps.getProperty(key));
            }
        }
    }
}

8.2 查看配置來源

啟用Actuator端點查看所有配置來源:

management.endpoints.web.exposure.include=env

訪問 http://localhost:8080/actuator/env 查看完整配置來源。

8.3 配置注入失敗

常見錯誤

// 錯誤:使用final修飾
@ConfigurationProperties(prefix = "app")
public class AppProperties {
    private final String name;  // 無法注入
}
// 正確:使用setter
@ConfigurationProperties(prefix = "app")
@Data
public class AppProperties {
    private String name;  // 可以注入
}
// 錯誤:在構(gòu)造函數(shù)中使用配置
@Component
public class MyService {
    @Value("${app.name}")
    private String appName;
    public MyService() {
        System.out.println(appName);  // null,此時還未注入
    }
}
// 正確:使用@PostConstruct
@Component
public class MyService {
    @Value("${app.name}")
    private String appName;
    @PostConstruct
    public void init() {
        System.out.println(appName);  // 正確輸出
    }
}

九、性能優(yōu)化建議

9.1 減少配置文件解析

# 不推薦:大量重復(fù)配置
app:
  service-a:
    url: http://service-a.example.com
    timeout: 5000
    retry: 3
  service-b:
    url: http://service-b.example.com
    timeout: 5000
    retry: 3
# 推薦:提取公共配置
app:
  default-timeout: 5000
  default-retry: 3
  services:
    a:
      url: http://service-a.example.com
    b:
      url: http://service-b.example.com

9.2 懶加載配置

@Component
@ConfigurationProperties(prefix = "app")
@Lazy
public class HeavyProperties {
    private Map<String, ComplexConfig> configs;
}

9.3 避免頻繁讀取配置

// 不推薦:每次調(diào)用都讀取
public String getServiceUrl() {
    return environment.getProperty("app.service.url");
}
// 推薦:啟動時讀取并緩存
@Component
public class ServiceConfig {
    private final String serviceUrl;
    public ServiceConfig(@Value("${app.service.url}") String serviceUrl) {
        this.serviceUrl = serviceUrl;
    }
    public String getServiceUrl() {
        return serviceUrl;
    }
}

十、總結(jié)

Spring Boot的配置管理機(jī)制設(shè)計精巧,提供了多層次、多來源的配置能力。掌握以下要點,能夠更好地管理應(yīng)用配置:

方式適用場景
@Value少量、簡單的配置項
@ConfigurationProperties大量、復(fù)雜的配置對象
Profile多環(huán)境切換
環(huán)境變量敏感信息管理
配置中心分布式環(huán)境集中配置
@Validated配置校驗

核心原則

  1. 分層管理:框架配置、中間件配置、業(yè)務(wù)配置分離
  2. 安全優(yōu)先:敏感信息絕不進(jìn)入代碼庫
  3. 文檔完善:配置項有清晰的說明和默認(rèn)值
  4. 按需選擇:根據(jù)實際場景選擇合適的注入方式
  5. 動態(tài)可調(diào):關(guān)鍵配置支持熱更新

參考資料:

到此這篇關(guān)于Spring Boot配置管理最佳實踐的文章就介紹到這了,更多相關(guān)springboot配置管理內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 一篇文章帶你了解Java SpringBoot四大核心組件

    一篇文章帶你了解Java SpringBoot四大核心組件

    這篇文章主要介紹了SpringBoot四大核心組件的使用小結(jié),詳細(xì)的介紹了這方面的知識,有興趣的可以了解一下,希望能夠給你帶來幫助
    2021-09-09
  • Spring中的接口重試機(jī)制spring-retry之listeners參數(shù)解析

    Spring中的接口重試機(jī)制spring-retry之listeners參數(shù)解析

    這篇文章主要介紹了Spring中的接口重試機(jī)制spring-retry之listeners參數(shù)解析,注解@Retryable有一個參數(shù)listeners沒有說明,那么本篇文章我們詳細(xì)介紹一個這個參數(shù)的用,需要的朋友可以參考下
    2024-01-01
  • SpringBoot控制臺秒變炫彩特效的實現(xiàn)指南

    SpringBoot控制臺秒變炫彩特效的實現(xiàn)指南

    本文介紹如何自定義SpringBoot啟動橫幅,通過banner.txt文件設(shè)置ASCII圖案、版本號等,并使用ANSI顏色增強(qiáng)效果,還提供關(guān)閉默認(rèn)Banner、添加啟動信息及彩色提示的實現(xiàn)方法,需要的朋友可以參考下
    2025-10-10
  • Activiti開發(fā)環(huán)境的搭建過程詳解

    Activiti開發(fā)環(huán)境的搭建過程詳解

    這篇文章主要介紹了Activiti開發(fā)環(huán)境的搭建過程詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-03-03
  • 在JAR文件中找不到主清單屬性的原因與解決方案

    在JAR文件中找不到主清單屬性的原因與解決方案

    在Java中,一個JAR文件通常包含一個名為MANIFEST.MF的清單文件,這個文件定義了關(guān)于JAR文件的各種元數(shù)據(jù),然而,有時我們可能會遇到一個問題,那就是在JAR文件中找不到主清單屬性,本文給大家介紹了JAR文件中找不到主清單屬性的原因和解決方案,需要的朋友可以參考下
    2024-04-04
  • 詳解Spring 兩種注入的方式(Set和構(gòu)造)實例

    詳解Spring 兩種注入的方式(Set和構(gòu)造)實例

    本篇文章主要介紹了Spring 兩種注入的方式(Set和構(gòu)造)實例,Spring框架主要提供了Set注入和構(gòu)造注入兩種依賴注入方式。有興趣的可以了解一下。
    2017-02-02
  • jdbc和mybatis的流式查詢使用方法

    jdbc和mybatis的流式查詢使用方法

    有些時候我們所需要查詢的數(shù)據(jù)量比較大,但是jvm內(nèi)存又是有限制的,數(shù)據(jù)量過大會導(dǎo)致內(nèi)存溢出。這個時候就可以使用流式查詢,本文就主要介紹了jdbc和mybatis的流式查詢,感興趣的可以了解一下
    2021-11-11
  • Java實戰(zhàn)之實現(xiàn)一個好用的MybatisPlus代碼生成器

    Java實戰(zhàn)之實現(xiàn)一個好用的MybatisPlus代碼生成器

    這篇文章主要介紹了Java實戰(zhàn)之實現(xiàn)一個好用的MybatisPlus代碼生成器,文中有非常詳細(xì)的代碼示例,對正在學(xué)習(xí)java的小伙伴們有非常好的幫助,需要的朋友可以參考下
    2021-04-04
  • MyBatis將查詢出的兩列數(shù)據(jù)裝配成鍵值對的操作方法

    MyBatis將查詢出的兩列數(shù)據(jù)裝配成鍵值對的操作方法

    這篇文章主要介紹了MyBatis將查詢出的兩列數(shù)據(jù)裝配成鍵值對的操作代碼,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-08-08
  • spring IOC中三種依賴注入方式

    spring IOC中三種依賴注入方式

    這篇文章主要介紹了spring IOC中三種依賴注入方式,Spring使用注入方式,為什么使用注入方式,這系列問題實際歸結(jié)起來就是一句話,Spring的注入和IoC(本人關(guān)于IoC的闡述)反轉(zhuǎn)控制是一回事
    2021-08-08

最新評論

麻城市| 松溪县| 福贡县| 蓬安县| 珠海市| 西畴县| 集安市| 安阳县| 年辖:市辖区| 巍山| 泗洪县| 宁阳县| 济宁市| 林芝县| 砚山县| 南部县| 景德镇市| 襄城县| 繁昌县| 武穴市| 吴川市| 永福县| 广丰县| 青浦区| 和政县| 家居| 富平县| 扶绥县| 鹰潭市| 宁晋县| 吴桥县| 达州市| 潍坊市| 中西区| 禄丰县| 高安市| 西充县| 科尔| 德兴市| 宜宾市| 海兴县|