java spring boot static 中如何 @Autowired
采用构造函数注入
public class ConnectionUtil{
public static RedisCache redisCache;
@Autowired
public ConnectionUtil(RedisCache _redisCache){
ConnectionUtil.redisCache=_redisCache;
}
}
禁止转载