如何在静态应用程序上下文中使用@Value?
我使用gauge spring演示https://github.com/getgauge-examples/ioc-spring构建了应用程序。
应用程序是使用AnnotationConfigApplicationContext启动的,请查看演示中的RegisterIOC.java。
我想在这个项目中使用@Value,但是@Value看不到application.yml属性,我有一个异常:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder有没有办法定制这个项目并在其中使用@Value?
发布于 2019-05-28 17:25:48
我没有找到使用aplication.yml的解决方案,但我创建了文件夹env/default/default.properties Gauge found properties,并且我能够使用@Value
https://stackoverflow.com/questions/56295724
复制相似问题