spring与springboot中,如何在static方法里使用自动注入的属性
第一步:写注解@Component 使当前类成为一个bean对象。(@Controller,@service都行) 第二步:写个static的变量 第三步:写个@PostConstruct注解注解 ...
第一步:写注解@Component 使当前类成为一个bean对象。(@Controller,@service都行) 第二步:写个static的变量 第三步:写个@PostConstruct注解注解 ...
springboot用@Autowired和@PostConstruct注解把config配置读取到bean变成静态方法 不用web,运行的方法implements Comman ...