第5章:坐标和依赖/5.9 最佳实践/5.9.2 依赖属性使用变量

  • 依赖属性使用变量
  1. 概念:用变量定义依赖的某一部分属性,具体依赖中直接使用这个依赖即可,这样做的好处是以后修改这个属性时只需要修改这个变量即可
  2. 语法:
    1. 定义变量:
      <properties>
      
      <!—变量名-->
      
      <springframework.version>2.6</springframework.version>
      
      <springframework.prename>spring</springframework. prename >
      </properties>
    2. 使用变量

      使用变量名

      ${ springframework.version}
      
      ${ springframework.prename}-core
  3. 举例:

猜你喜欢

转载自blog.csdn.net/u011830122/article/details/83650016