【发布时间】:2018-10-13 00:30:02
【问题描述】:
请在下面找到 application.yml 的代码
decrypt: /Users/Blahblah/Bleh
上面我们试图读入一个类的属性请找到PropertyLoader.java的代码
@Configuration
@Component
public class PropertyLoader implements InitializingBean{
@Value("${decrypt}")
private String decryptPath;
<--->
}
decryptPath 的值始终为空。谁能告诉我代码有什么问题?
【问题讨论】:
-
application.yml 是在 src/main/resources 文件夹还是其他地方
-
你能粘贴完整的 application.yml 吗?
-
@sumitsingh 一切都正确缩进。
标签: java spring-boot yaml