一、使用@Value("${xxx}") 智能给普通变量注入值, 不能给静态变量注入值 二、使用set()方法,在类上加上@Component 参考链接,带补充 https://blog.csdn.net/mononoke111/article/details/81088472