@Value应用在static修饰的静态变量无法获取值。非静态变量才可以获取到值。
@Value原理是使用属性的set方法注入属性值。
1、spring不允许/不支持把值注入到静态变量中 2、Spring的@Value依赖注入是依赖set方法 3、set方法是普通的对象方法 4、static变量是类的属性,static没有set方法
参考:
https://www.cnblogs.com/kiko2014551511/p/11533558.html
https://blog.csdn.net/qq_40734247/article/details/110983210