Profile:

    Profile为在不同环境下使用不同的配置提供了支持。

    (1)通过设定Environment的ActiveProfiles来设定当前context需要使用的配置环境。在开发中使用@Profile注解类或者方法,达到在不同情况下选择实例化不同的Bean。

    (2)通过设定jvm的spring.profiles.active参数来设置配置环境。

    (3)Web项目设置在Servlet的Context parameter中。

Spring Configuration(五):Profile


    @Profile(value = {"sit", "testing", "stage"})    



相关文章:

  • 2021-05-18
  • 2022-02-19
  • 2021-07-19
  • 2022-12-23
  • 2021-05-26
  • 2021-05-12
  • 2021-04-16
  • 2021-05-22
猜你喜欢
  • 2021-11-10
  • 2021-07-08
  • 2021-04-26
  • 2022-01-30
  • 2022-01-23
  • 2022-12-23
  • 2021-12-03
相关资源
相似解决方案