Ale*_*lor 8 spring spring-annotations
我的应用程序从环境变量获取属性文件的位置,它可能不在WEB-INF文件夹中.我找不到文件,但这个文件肯定存在.我不想使用classpath:前缀,我不希望它相对于应用程序根目录.
@PropertySource("${propfile}")
public class ... {
Run Code Online (Sandbox Code Playgroud)
Ale*_*lor 16
要使用绝对路径,请file:在开头尝试.
@PropertySource("file:${propfile}")
Run Code Online (Sandbox Code Playgroud)
来源:http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/PropertySource.html
| 归档时间: |
|
| 查看次数: |
3346 次 |
| 最近记录: |