spring_reference/IV. Spring Boot features/23.5. Placeholders in prope...

9 lines
520 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 23.5. 属性占位符
当application.properties里的值被使用时它们会被存在的Environment过滤所以你能够引用先前定义的值比如系统属性
```java
app.name=MyApp
app.description=${app.name} is a Spring Boot application
```
**注**你也能使用相应的技巧为存在的Spring Boot属性创建'短'变量,具体参考[Section 63.3, “Use short command line arguments”](../IX. How-to guides/63.3. Use short command line arguments.md)。